Jump to content

[SOLVED] Works fine locally but not on a live server


Boo-urns

Recommended Posts

I have a dropdown and when a user selects how many entries they want to add it calls a file to create a form and bring it back. Well it works great locally but not on a live server. Firebug is saying I'm getting a 500 error. (I've tried absolute and relative paths but it's not working.) If I copy the include file on that script page it will run hardcoded but isn't getting the variables. The data posts just fine but PHP isn't pulling the variables.

<?php $numForms  = mysql_real_escape_string($_REQUEST['numForms']);

Is something screwed up in the php.ini file or something on the server? Any ideas? I'm stumped  :(

 

-Corey

Another interesting thing that might help is if I send the variable back via json_encode

$arr = array ('errors'=>$error,'output'=>$output, 'numForms'=>$_REQUEST['numForms']);
echo json_encode($arr);

It will display the correct number for numForms.

Have you done a "view source" of the form so that you know it is being created correctly?

 

Have you echoed $_REQUEST['numForms'] so that you know what is in it?

 

Is the problem that $numForms is not set, in which case you probably don't have a valid mysql connection at the time the mysql_real_escape_string() statement is being executed. Do you have any error checking logic as part of your mysql_connect() statement so that you know if it worked of failed? Are you executing this code on a system with error_reporting set to E_ALL and display_errors set to ON to get php to help you?

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.