|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Heya, can anybody help me with this code,
im trying to post the $firstName variable to the page... the error msg that comes up is : Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' PHP Code:
thanks everybody! |
|
#2
|
||||
|
||||
|
You have problems with your quotes by trying to access the array key. Asside from that, variables are not interpreted when placed in a string enclosed in single quotes. Use either double-quotes with complex syntax, or single quotes and string concatenation.
Code:
echo '<div id="content"> <div class="right"><h2><a href="">'.$_POST['firstName']; or Code:
//Your slashes to escape the quotes are also wrong. You use backslash \, not forward slash /.
echo "<div id=\"content\"> <div class=\"right\"><h2><a href=\"\">{$_POST['firstName']}"
__________________
Spidermonkey Tutorial http://www.aoeex.com/gmap.php - Put yourself on the map |
|
#3
|
|||
|
|||
|
cheers, problem sorted- iv got another code problem though if you could assist me,
error message: Warning: Cannot modify header information - headers already sent by (output started at...(ive highlighted the line Code: PHP Code:
thankyou |
|
#4
|
|||
|
|||
|
PHP Code:
There, you have to 'echo' the last bit so use this instead. PHP Code:
Try reading a book on PHP or find a good tutorial, you'll learn how to write less buggy code. In two instances you forgot to add " in to echoed stuff, so in that line and in the last line. Is that all the code? I didn't see a header in there. Remember when you use headers, the header has to be inserted before code that sends anything to the browser. |
|
#5
|
|||
|
|||
|
cheers, for your help, yea just added a few headers recently - made sure they were b4 the code too !
![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > PHP Development > Problems with this code? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|