938660 Posted October 23, 2007 Share Posted October 23, 2007 Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/pipes/domains/pipes.pesladder.com/public_html/edit.php on line 545 ----line 545 is the 5th echo down. echo "<form>"; echo "<fieldset>"; echo "<label>"; echo "<span><b>Title:</b></span>"; echo "<span class="price"><input name="title" type="text" id="title" value="<? echo $_SESSION['firstname']?>" size="24" />"; echo "</span>"; echo "</fieldset>"; echo "</form>"; Link to comment https://forums.phpfreaks.com/topic/74433-solved-what-is-wrong-with-this-syntax-small-piece-of-code/ Share on other sites More sharing options...
enoyhs Posted October 23, 2007 Share Posted October 23, 2007 echo "<form>"; echo "<fieldset>"; echo "<label>"; echo "<span>Title:</span>"; echo "<span class='price'><input name='title' type='text' id='title' value='" . $_SESSION['firstname'] . "' size='24' />"; echo "</span>"; echo "</fieldset>"; echo "</form>"; Of course to make it much simpler you could have written this like this: <form> <fieldset> <label> <span>Title:</span> <span class="price"><input name="title" type="text" id="title" value="<? echo $_SESSION['firstname']?>" size="24" /> </span> </fieldset> </form> In php everything must not be echoed. Everything that you want tot put out in php tags though must be. So simply use php tags only when you need them. Link to comment https://forums.phpfreaks.com/topic/74433-solved-what-is-wrong-with-this-syntax-small-piece-of-code/#findComment-376049 Share on other sites More sharing options...
Azu Posted October 23, 2007 Share Posted October 23, 2007 echo "<span class="price"><input name="title" type="text" id="title" value="<? echo $_SESSION['firstname']?>"[/u][/b] size="24" />"; The bold and underlined things are the problems. Replace those double quotes " with single quotes ' And replace the PHP reinitialization/echo with simply putting the variable there without all that. Here I fixed it for you just replace it with this; echo "<span class='price'><input name='title' type='text' id='title' value='$_SESSION[firstname]' size='24' />"; Link to comment https://forums.phpfreaks.com/topic/74433-solved-what-is-wrong-with-this-syntax-small-piece-of-code/#findComment-376050 Share on other sites More sharing options...
938660 Posted October 23, 2007 Author Share Posted October 23, 2007 Thankyou both for your help. You were correct Azu . Link to comment https://forums.phpfreaks.com/topic/74433-solved-what-is-wrong-with-this-syntax-small-piece-of-code/#findComment-376054 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.