Jump to content

Archived

This topic is now archived and is closed to further replies.

Sl4ckB0t

Can't POST GET on Apache ## HELP ! ##

Recommended Posts

I\'m Not a Newbie but new to SUSE. I set up Suse 8.1 pro on a new server. I\'m having the most aggravating computer problem ever, here goes:

 

installed apache: works (serves pages)

installed php: works ( php code is executed properly at shell )

installed phpmod: works ( php/html code is executed properly and served by apache)

installed phpMyAdmin: works (can login, create and change databases)

 

So what\'s the problem you ask ???? Even though phpMyAdmin and also Mpanel work flawlessly I can not post or get a simple test form. The form works fine on other servers.

 

----- test.php ------

 

<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">

<html>

<head>

<meta http-equiv=\"content-type\" content=\"text/html; charset=ISO-8859-1\">

<title><? echo \"Freakin Test\"; ?></title>

</head>

<body>

Test Form<br>

<form method=\"post\" action=\"post.php\">

<input type=\"text\" name=\"textbox\" maxlength=\"12\" />

<input type=\"submit\" value=\"Submit\" />

</form>

</body>

</html>

 

--------

 

------ post.php ------

 

<html>

<? echo \"Test:\" ?><br>

<? echo \"<br>$textbox<br>\" ?>

<a href=\"./test.php\">back</a>

</html>

 

--------

 

I\'m on my third day and still stuck, Please Help!!

Share this post


Link to post
Share on other sites

This may be a shot in the dark, but I had to make sure the following was set in the php.ini-dist

 

register_globals = on

 

It should be on or around line 355

 

I found this fix somewhere in this forum earlier when I had the same type of problem when trying to get a form to work.

 

Hope that works for you...

 

Hexzero

Share this post


Link to post
Share on other sites

that will prolly get your variable to work but that isn\'t the best solution

 

as of version 4.2.0 register globals were set to be off by default for security reasons.

 

If you intend to write alot of php code, download others php code, or share the code that you write in php I would suggest going with the new standard.

 

leave register_globals off

when you want to use the variable from your form in post.php

access it like this

 

$_POST[\'textbox\'];

 

if your form method was GET you would use

 

$_GET[\'textbox\']

 

good luck.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.