Jump to content

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


Sl4ckB0t

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!!

Link to comment
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

Link to comment
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.