Page 1 of 1

PHP code not running on friends internal network

Posted: Mon Jun 22, 2009 2:28 pm
by javaftper
hi,

i have created a survey web page using xhtml, javascript for client side validation and php for server side validation, logic, database updates and to send an email notification that the survey has been completed.

the whole thing works fine on my laptop and pc and my friend's home pc's however on the charity's internal network the html page displays and javascript validation works fine however when the submit button is pressed, configured as below, nothing happens-

Code: Select all

   
<form action="mainsub.php" method="post">
<form id="form1" name="form1" method="post" action="">
  ...html form code for radio button's, text areas etc
<input type="submit" name="SUBMIT" id="SUBMIT" value="Submit" accesskey="s" /> 
 
the code in mainsub.php is a long php file responsible for updating the db and sending an email etc therefore i have put an example of each php type, function and methods i have used below. my assumption is that a setting or restriction has been applied by the network administrator. i do not wish to change a network setting in case people using the survey have the same issue. therefore i wish to fix this problem by changing a setting/s on my web server (apache), php.ini file or removing/changing a function in order to comply with the network settings or whatever is causing the code not to run.

Code: Select all

 
 
$rating = Array(0=>'Strongly Agree',
1=>'Agree',
2=>'Neutral',
3=>'Disagree',
4=>'Strongly disagree');
 
// Get all $_POST variables
foreach($_POST as $var => $val) { ${$var} = $val; }
 
$response8bTel = "tel8b_".$rank1_5[$tel8bGroup]; 
 
$body_body .=  "----------------------------------------------------\n";
 
$to = 'jim <james@########.co.uk>';
$subject = 'Website Survey Results';
$body = $body_body.$body_footer;
 
mail($to, $subject, $body);
 
echo '<div style="white-space: pre">';
print_r(str_replace("\n", "<br />",$body));
echo '</div>';
 
 

Re: PHP code not running on friends internal network

Posted: Mon Jun 22, 2009 2:38 pm
by requinix
What exactly does "nothing happens" mean? Form doesn't work? The page doesn't load? Database isn't updated?

Re: PHP code not running on friends internal network

Posted: Mon Jun 22, 2009 5:05 pm
by javaftper
Hello

thank you for your response and interest in this issue.

Sorry, I was not clear- when clicking the submit button on the HTML page, the HTML page remains with nothing changing instead of progressing onto the PHP feedback page which also updates the database and sends an e-mail record.

One way of describing it would be that It behaves as if no event has been defined against the on_click event handler.

Any advice you can offer would be greatly appreciated.

--James

Re: PHP code not running on friends internal network

Posted: Mon Jun 22, 2009 6:27 pm
by requinix
Then this problem isn't PHP related.

Run your HTML through a validator - you'll probably find problems with it.
Like having a <form> inside of a <form>...