parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
shiranwas
Forum Commoner
Posts: 53
Joined: Fri Jul 07, 2006 10:41 pm
Location: Colombo

parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_

Post by shiranwas »

Everah | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


prase error popup for tis coding what is the problam

Code: Select all

echo ' <input type="text" name="textfield" value=" <? print $a ?>">';

shiran thanks


Everah | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

more code please... and make sure you put them in

Code: Select all

tags please.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Your syntax is wonky. Try this...

Code: Select all

echo '<input type="text" name="textfield" value="' . $a .'">';
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Re: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_

Post by s.dot »

shiranwas wrote:Everah | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


prase error popup for tis coding what is the problam

Code: Select all

echo ' <input type="text" name="textfield" value=" <? print $a ?>">';

shiran thanks


Everah | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color][/quote]

Since you're already echo'ing it, I'll assume you're already inside a php code block

Code: Select all

echo ' <input type="text" name="textfield" value="'.$a.'">';
would work

[edit] nice one everah =]
Last edited by s.dot on Wed Aug 16, 2006 12:08 am, edited 1 time in total.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
shiranwas
Forum Commoner
Posts: 53
Joined: Fri Jul 07, 2006 10:41 pm
Location: Colombo

Post by shiranwas »

i was able to correct the parse error , there was a ; missing but yet the value of $a won't print
can u help me please.



Code: Select all

$_SESSION['userlevel'] =$row[levelid];
$a=$_SESSION['userlevel'];

echo $a;  //this print the value of the $a


//but this part not working
echo ' <input type="text" name="textfield" value=" <? print $a ?>">';
shiran
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

$a gets its value from $_SESSION['userlevel'], which gets its value from $row['levelid'] (note the use of quotes). Where is $row getting its value from?

And again, to reiterate, this...

Code: Select all

echo ' <input type="text" name="textfield" value=" <? print $a ?>">';
WILL NOT WORK. Change it to...

Code: Select all

echo '<input type="text" name="textfield" value="' . $a . '">';
User avatar
shiranwas
Forum Commoner
Posts: 53
Joined: Fri Jul 07, 2006 10:41 pm
Location: Colombo

Post by shiranwas »

thanks alot for your help
its woked and could send me some tutorial or links about using '' ""


thanbks again
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Post Reply