ClioSport.net

Register a free account today to become a member!
Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • When you purchase through links on our site, we may earn an affiliate commission. Read more here.

Very Easy PHP question



  GW RS200
Hi guys!

My little form script has stopped passing variables to a results page, basically because my hosts have set register_globals to 0. Could someone suggest where I might be able to find an alternative way of doing things, please? I've tried the PHP forum, but it's like a needle in a blooming haystack!!

Thanks if you can...

Steve
 

KDF

  Audi TT Stronic
if your form is using GET to post the data your variables are available as

$_GET['yourvariable']

if your using POST to post the data use

$_POST['yourvariable']

its a security thing.. your ISP should have had this turned on since day one ! At least gimme a challenge :(
 
  GW RS200
Hi mate - thanks for the help! No luck though :-(
I get a blank where the variable value should appear in the results page. Here's the code:

Form.html
***********
<form id="form1" name="form1" method="post" action="steve.php">
<p>
<input type="text" name="venue" id="venue" />
Venue
</p>
<p>
<input type="submit" name="button" id="button" value="Submit" />
</p>
</form>
************

Steve.php
************
<?php

echo "test3<br>";

$_POST['$venue'];

echo "venue = $venue<br>";

?>
************
 
  GW RS200
Thanks mate I just missed out putting

<? import_request_variables("gP"); ?>

at the top of my script.

Thanks so much for your help :)

Steve
 

KDF

  Audi TT Stronic
Glad you got it sorted.. just for reference..

its not

$_POST['$venue'];

it would be

$_POST['venue'];

minus the additional $ you have already declared that its a variable using the first $ in $_POST ;)


Additionally, you should really use extract(); to get the variable data is using import_request_variables is basically as insecure as if your ISP left register_globals() switched on :p
 


Top