Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

GEt & POST

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

GEt & POST

Postby psycho » Tue Nov 26, 2002 7:11 am

Hi all,

I'm new to PHP linking what i read in the books.
Understanding is going a bit slow , but there is a pain in my brain that will not go.
So i turn to you, for helping me find a cure.

I read PHP 4 bilbe..

The book has a part about GET and POST method wel there is something i don't understand about this.

Here is the code i use
Code: Select all
<FORM METHOD=POST ACTION="test2.php">
    <SELECT NAME="Artiesten" align="center">
      <?PHP
$hallo = "*";                      \\ to see if i could use variable in a SQLstring
mysql_connect("$host") or die ("No COnnection");
mysql_select_db("$db") or die ("No Databasr Selected");

$query = "SELECT $hallo FROM Artiesten";
$result = mysql_query($query);
While($Artiesten = mysql_fetch_array($result))
{
print ("<OPTION VALUE=$Artiesten>$Artiesten[0]\n");
}
?>
    </SELECT>
<input type=submit>
</FORM>


On the next page "test2.php the thing for me to do is something like

Code: Select all
print ("$Artiesten");

But that's not the question

i tryed to use the GET and POST method to get the info on the test2.php.
even diffenrent scripts from the book.
But i never get any results back.

here is my question.
Could there be something in my PHP.INI that is blocking the result to get to the "test2.php" page.
this because i have the feeling it's not handeld by PHP as i should.

Thanks for you time, hope you have the cure.
HAve a nice day.
Psycho
psycho
New php-forum User
New php-forum User
 
Posts: 10
Joined: Tue Nov 26, 2002 5:35 am
Location: The Nehterlands

Re: GEt & POST

Postby Oleg Butuzov » Tue Nov 26, 2002 7:35 am

<FORM METHOD=POST ACTION="test2.php">
<SELECT NAME="Artiesten" align="center">
<?PHP
$hallo = "myrow"; \\ exemple of the var
mysql_connect("$host") or die ("No COnnection");
mysql_select_db("$db") or die ("No Databasr Selected");

$query = "SELECT $hallo FROM Artiesten";
$result = mysql_query($query);
While($Artiesten = mysql_fetch_array($result))
{
print ("<OPTION VALUE=$Artiesten>$Artiesten[myrow]\n");
}
?>
</SELECT>
<input type=submit>
</FORM>
[/code]

On the next page "test2.php the thing for me to do is something like

Code: Select all
echo $_POST['Artiesten'];





in php.ini register_globals = On ...
Oleg Butuzov
Last Samuray
Last Samuray
 
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Thanks

Postby psycho » Tue Nov 26, 2002 8:02 am

Thanks pejone,

The problem was register_globals = On.

Have a nice day
Psycho
psycho
New php-forum User
New php-forum User
 
Posts: 10
Joined: Tue Nov 26, 2002 5:35 am
Location: The Nehterlands

Postby Oleg Butuzov » Tue Nov 26, 2002 9:01 am

Pejone! not pejone :evil:
Oleg Butuzov
Last Samuray
Last Samuray
 
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

oeps

Postby psycho » Tue Nov 26, 2002 11:26 am

will not happen again :roll:

Have a nice day
Psycho
psycho
New php-forum User
New php-forum User
 
Posts: 10
Joined: Tue Nov 26, 2002 5:35 am
Location: The Nehterlands

Postby Oleg Butuzov » Tue Nov 26, 2002 1:13 pm

ok :)
Oleg Butuzov
Last Samuray
Last Samuray
 
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am


Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron