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
dwfait
Forum Contributor
Posts: 113 Joined: Sun Aug 01, 2004 10:36 pm
Post
by dwfait » Mon Aug 02, 2004 1:19 am
whenever i try to do:
$ssppluser = "$_POST["user"]"
i get the error:
Parse error: parse error, unexpected '\"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in action.php on line 2
djot
Forum Contributor
Posts: 313 Joined: Wed Jan 14, 2004 10:21 am
Location: planet earth
Contact:
Post
by djot » Mon Aug 02, 2004 2:18 am
Code: Select all
<?php
$ssppluser = $_POST["user"];
?>
dwfait
Forum Contributor
Posts: 113 Joined: Sun Aug 01, 2004 10:36 pm
Post
by dwfait » Mon Aug 02, 2004 9:15 am
Thank you, it works
hawleyjr
BeerMod
Posts: 2170 Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA
Post
by hawleyjr » Mon Aug 02, 2004 9:58 am
If you are just using $ssppluser as a reference to the $_POST[] var use the following code:
Code: Select all
<?php
$ssppluser = &$_POST['user'];
?>
d3ad1ysp0rk
Forum Donator
Posts: 1661 Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA
Post
by d3ad1ysp0rk » Mon Aug 02, 2004 11:10 am
Why would you be? I don't think references come after learning how to set variables. I think it's after OOP in the php-learning-trend
hawleyjr
BeerMod
Posts: 2170 Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA
Post
by hawleyjr » Mon Aug 02, 2004 12:40 pm
Ha! good point...force of habit...