Welcome to WebmasterWorld Guest from 22.214.171.124 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Become a Pro Member
Echo command has stopped working glamdring
I wonder if someone can help me out : on a site that I run, a PHP script appears to have stopped working : I think my host has upgraded me to the latest version of PHP and maybe this has done it, but I dont know how to fix it:
The variable that gets passed is like this :
<option value="55.00">1 ticket</option> <option value="110.00">2 tickets</option> <option value="165.00">3 tickets</option> <option value="220.00">4 tickets</option> <option value="275.00">5 tickets</option> </select>
and what picks it up - and has worked flawlessly until now, in the next page is :
<p align="center" class="style9">Total Cost £ <?php echo "$quantity"?></p>
Any suggestions would be welcome - I've about pulled all my hair out with it.
Might be the register global or something.
Did you try echo $_POST['quantity']?
Splendid. That works - thanks.
Those values (along with others) should get passed into a mySQL db by the next page using :
$date = date("Y-m-d G:i:s") ; $db="databasename"; mysql_query ("INSERT INTO databasename (variable1, variable2, etc) VALUES ('$variable1','$variable2','$etc')"); ?>
which has also worked flawlessly until now. The two SQL generated fields, "id" and "date" (datetime) go into the DB okay, but the other eleven-odd fields do not, leaving me with aload of blank entries...
Again, i'm baffled because this has worked fine until now, and then just stopped in the last few days when the upgrade came.
It's definately the fact that register_globals [ php.net] is now turned off.
You will need to go through all your scripts and replace the shortcut references.
...OR...the quick and dirty way
extract($_POST); // for forms
extract($_GET); // for query string variables
// Now you can leave the rest of the script intact...
thanks a lot for your help