Page 1 of 1
Passing variables from a linux server to a windows server
Posted: Tue Jan 06, 2004 4:08 pm
by robster
Hi all,
I know there are a zillion pass variables threads but this one is strange.
I have a main server, linux based. Due to laziness and a good deal my storage server (for animation mpg video files etc) is the windows server.
I have a functional (until today) form that gets info from the database on the linux box and sends it to the windows box.
In the past it has worked fine. This day though, it decided to stop. I haven't changed the code at ALL, it just stopped.
I send it with submit then try and ready $submit at the other end and it tells me it can't read $submit on that end, though, some variables are DEFINATELY being passed, just not all of them.
Has anyone heard of such a thing? Why would it just change?
The ONLY thing that has happened in the time since I last used it successfuly (which was yesterday) is the host installed GD onto the windows server for me (the one not accepting the Submit variable it seems). Could this have done anything. SO VERY strange, and very anoying. I REALLY need this form working fast but I just can't figuire it out!
Thanks to anyone who can offer advice.
Rob
Posted: Tue Jan 06, 2004 5:23 pm
by Sevengraff
are you accessing the data as $submit or $_POST['submit']?
Posted: Tue Jan 06, 2004 5:27 pm
by JAM
Code: Select all
echo '<pre>';
echo 'PHP Version: '.phpversion()."\n";
echo 'Register Globals: '.(ini_get('register_globals') == '' ? 'Off' : 'On')."\n";
echo '</pre>';
If you don't mind, try the following script and let us know what it returns.
Sevengraff is on to something, and if correct we can use that as a guiding tool.

Posted: Tue Jan 06, 2004 5:45 pm
by robster
Thanks for the help!
This is what it returns:
PHP Version: 4.3.1
Register Globals: Off
Now, I am sending the data like this from the linux server:
Code: Select all
// the values to be sent on again
print "<input type="hidden" name="animator" value="$animator" />";
print "<input type="hidden" name="title" value="$title" />";
print "<input type="hidden" name="hardware" value="$hardware" />";
print "<input type="hidden" name="software" value="$software" />";
print "<input type="hidden" name="creationtime" value="$creationtime" />";
print "<input type="hidden" name="rendertime" value="$rendertime" />";
print "<input type="hidden" name="viewrecommend" value="$viewrecommend" />";
print "<input type="hidden" name="descriptionofcreation" value="$descriptionofcreation" />";
print "<input type="hidden" name="animdescription" value="$animdescription" />";
print "<input type="hidden" name="forum_uid" value="$uid" />";
print "<input type="hidden" name="new_id" value="$id" />";
print "<input type="hidden" name="sound_id" value="$id" />";
print "<input type="hidden" name="sound_year" value="$year" />";
print "<input type="hidden" name="sound_month" value="$month" />";
print "<input type="hidden" name="entrynumber" value="$uid" />";
print "<input type="hidden" name="year" value="$year" />";
print "<input type="hidden" name="month" value="$month" />";
print "<input type="hidden" name="jpg" value="$jpg" />";
print "<input type="hidden" name="mpg" value="$mpg" />";
// the button
print "<input type="submit" name="Submit" value="Edit your JPG"><br /><br />";
and from the windoze server I am trying to access it like so:
Code: Select all
//if the user presses the edit JPG button they get this :)
if ($Submit == "Edit your JPG")
{
$animator = stripslashes($_POSTї'animator']);
$title = stripslashes($_POSTї'title']);
$forum_uid = stripslashes($_POSTї'forum_uid']);
$new_id = stripslashes($_POSTї'new_id']);
$sound_id = stripslashes($_POSTї'sound_id']);
$sound_year = stripslashes($_POSTї'sound_year']);
$sound_month = stripslashes($_POSTї'sound_month']);
$jpg = stripslashes($_POSTї'jpg']);
$mpg = stripslashes($_POSTї'mpg']);
$year = stripslashes($_POSTї'year']);
$month = stripslashes($_POSTї'month']);
}
It has always worked until today...
Thanks for looking at this for me guys...
Rob
Posted: Tue Jan 06, 2004 5:50 pm
by JAM
...is the key.
Code: Select all
...
if ($Submit == "Edit your JPG")
{
$animator = stripslashes($_POST['animator']);
...
<hint>You are using $_POST at all places, except $submit.

</hint>
Posted: Tue Jan 06, 2004 6:08 pm
by robster
see.. now I feel just plain stupid
Here is the correct code for anyone in the future:
Code: Select all
if (stripslashes($_POSTї'Submit']) == "Edit your JPG")
{
$Submit = stripslashes($_POSTї'Submit']);
$animator = stripslashes($_POSTї'animator']);
$title = stripslashes($_POSTї'title']);
$forum_uid = stripslashes($_POSTї'forum_uid']);
$new_id = stripslashes($_POSTї'new_id']);
$sound_id = stripslashes($_POSTї'sound_id']);
$sound_year = stripslashes($_POSTї'sound_year']);
$sound_month = stripslashes($_POSTї'sound_month']);
$jpg = stripslashes($_POSTї'jpg']);
$mpg = stripslashes($_POSTї'mpg']);
$year = stripslashes($_POSTї'year']);
$month = stripslashes($_POSTї'month']);
}
There is one more question now, and it's related (I am guessing my host changed globals to off last night?!)
I have this line of code:
Code: Select all
if ($_REQUESTї'submitted']){ // Begin processing portion of script
and it produces this error:
Notice: Undefined index: submitted in
path\hidden\for\security\upload.php on line
81
That code is taking form data from the SAME page on the windoze server (upoad.php) in this form:
Code: Select all
<input type="hidden" name="submitted" value="true">
<input type="submit" name="submit" value="Upload">
erm, I am lost now...
I just want to also thank you so much for helping me out you two

I am really a newby and it was an easy oversight for me.
Posted: Tue Jan 06, 2004 6:16 pm
by Sevengraff
You could try to check if the variable exists
Code: Select all
if( isset($_REQUESTї'submitted']) ) {
// do things
}
Or, check to see if any data was submitted at all
Code: Select all
if( !empty( $_POST ) ) {
// do things
}
Posted: Tue Jan 06, 2004 6:32 pm
by d3ad1ysp0rk
*waits for nay to yell about heardoc*.. :p
Posted: Tue Jan 06, 2004 6:36 pm
by robster
That last post lost me
The wierd thing is it is reporting that nothing has been posted even though it's printing variables from the post.... using your code:
if( !empty( $_POST ) ) {
echo "erm, no data posted... bummer ";
}
It would print to the browser:
erm, no data posted... bummer but it would also print variables sent from the linux server (in original post). If I submit on form on that page it also sends the same error (erm, no data posted... bummer).... so I am a bit lost now.
STRANGE indeed....
I guess I'll do some pokey jiggery and see what I come up with. Thanks everyone for your help, I REALLY appreciate it.
Well, thanks again!
I'll be sure to check back here incase someone has a suggestion.
Rob
Posted: Tue Jan 06, 2004 6:40 pm
by JAM
LiLpunkSkateR wrote:*waits for nay to yell about heardoc*.. :p
Hahaha... Now that you mention it...
@
robster:
Never mind that post. You'll find out what that means when you've been around for a while, trust me. ;)