Jump to content

Problem with form submission


JonasE

Recommended Posts

hello all,

 

I have run into a bit of an issue... On my three development boxes I run Gentoo, BSD and Windows with practically the same PHP config along with Apache 2. A project I recently completed was just uploaded to a client's server running Apache 2 and PHP (5.2.1). I can no longer submit any data from forms:

 

page.html

<form action="page2.php?action=insert" method="post">

 

Name<br />

 

<input size="40" name="name" type="text"><br />

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

 

</form>

 

page2.php

if(!isset($_REQUEST['action'])){

die("No function Value given");

}

$action = $_REQUEST['action'];

 

switch($action) {

case 'insert':

$name = $_REQUEST['name'];

// Create instance of database class and connect.

$mysql = new mysql();

$mysql->connect();

// Do insert.

$insert = $mysql->insert("database","name","$name");

// Redirect to main listing.

header('Location: index.php');

break;

}

 

Like I said, this has worked flawless up until now... Now when I submit I get a blank page with the URL showing as page2.php?action=insert

I thought this was due to register globals, but as far as I know, I am handling that correctly... And it is also "off" on my tests servers.

I am going crazy over this, does anyone have any idea what is going??

 

Thanks,

 

Jonas

Link to comment
https://forums.phpfreaks.com/topic/46664-problem-with-form-submission/
Share on other sites

I have tried changing the code in several different ways already... What bothers me the most though is that, like I said, this works on 4 other servers... What in the server configuration could cause something like this? No data is being passed through forms what so ever...

 

Jonas

Archived

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

×
×
  • 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.