PDA

View Full Version : Image - PHP - Newbie to PHP ='[



Recursion
21-08-2006, 05:44 PM
Again im not posting this in the coding section as only about 30 people look at.
ive got this PHP Code:

<?php
// starts php
include "usersystem/config.php";
// includes the config file
if (!$logged['username'])
// checks if user is logged in
die("You must be a member to view this page. To be able to use this uploader please contact");
// stops user from viewing page
?>

Where it says i want to put and image to stop spam bots reading the message. Ive got this Image:


Could someone help a PHP Newbie :)

Thanks, will +REP,
:.:Numark:.:

Mentor
21-08-2006, 06:49 PM
<?php
// starts php
include "usersystem/config.php";
// includes the config file
if (!$logged['username'])
// checks if user is logged in
die("You must be a member to view this page. To be able to use this uploader please contact ");
// stops user from viewing page
?>

Recursion
21-08-2006, 08:43 PM
worked perfectly thanks :) +REP

uber
21-08-2006, 08:49 PM
With PHP, you can use HTML but instead of using " use '
Hope it helps :D

speed-networks!
21-08-2006, 08:55 PM
I gave eorr a rep aswell

Eric30
21-08-2006, 09:10 PM
With PHP, you can use HTML but instead of using " use '

You shouldnt use ' really, because it can cause errors.

you should use " but you have to put a \ in front of it, in the php, eg:

$string = "Here is a link: <a href=\"page.php\">Link</a>";

Tomm
21-08-2006, 09:18 PM
This is HTML not PHP :s

Mentor
22-08-2006, 12:43 PM
You shouldnt use ' really, because it can cause errors.

you should use " but you have to put a \ in front of it, in the php, eg:

$string = "Here is a link: <a href=\"page.php\">Link</a>";

Well technically both are right, as are a number of other methods of achieving the same thing, since there's nothing in the mark up itself requiring a different quote mark, such as javascript often can, there was abosulty no point in useing shashed quotion marks, plus usealy you would only slash the rairest mark type, not the most common, for the simple fact it would be more work "/

Eric30
22-08-2006, 12:59 PM
Yea, both work, but you dont normally write html with '

I remember having problems with JS and maybe CSS when using '
That was a long time ago lol, but anyway, i always use \" as it outputs the html the way most people write html

Mentor
22-08-2006, 02:33 PM
Yea, both work, but you dont normally write html with '

I remember having problems with JS and maybe CSS when using '
That was a long time ago lol, but anyway, i always use \" as it outputs the html the way most people write html

w3 allows for both types of quoteation marks, even in the strict dtd's, if you want to use " in the code you open the php output aria with ' insted o.0

nets
22-08-2006, 11:10 PM
You shouldnt use ' really, because it can cause errors.

you should use " but you have to put a \ in front of it, in the php, eg:

$string = "Here is a link: <a href=\"page.php\">Link</a>";
It doesn't cause errors? Normally I use an apostrophe in PHP and quotation marks in HTML; they're pretty much the same, although you could argue that an apostrophe is faster as PHP doesn't check the contents for variables (thereby speeding up the process, although by an unnoticeable amount; and you're making your code messier than necessary).


$phrase = 'cool';
$string = 'Bob\'s '.$phrase;


$phrase = "cool";
$string = "Bob's $phrase";

Eric30
23-08-2006, 08:57 PM
As i said in my second post,
I had problems with CSS and JS

But its all personal prefrence, no big deal.

Want to hide these adverts? Register an account for free!