Author |
Message |
missdanni
Hangin' Around
![](modules/Forums/images/avatars/blank.gif)
Joined: Jul 06, 2005
Posts: 25
|
Posted:
Sat Oct 29, 2005 8:28 am |
|
Simple issue - Data is passed and echos fine, however is not passed to check_status() .... im having a brain dead day ... what am I missing ?
Code:echo "
<form name=\"imcheck\" method=\"post\" action=\"test.php\">
<table width=\"0%\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\">
<tr>
<td><strong>Messenger Service : </strong></td>
<td><select name=\"ms\">
<option selected>Select</option>
<option value=\"yim\">YIM</option>
<option value=\"msn\">MSN</option>
<option value=\"aim\">AIM</option>
</select></td>
</tr>
<tr>
<td><strong>User ID : </strong></td>
<td><input name=\"id\" type=\"text\"></td>
</tr>
<tr>
<td> </td>
<td><div align=\"right\">
<input type=\"reset\" name=\"Reset\" value=\"Reset\">
<input type=\"submit\" name=\"Submit\" value=\"IM Check\">
</div></td>
</tr>
</table>
</form>
";
check_status('$ms', '$id', 0);
echo " '$ms' '$id' ";
|
Ok I have messed around somemore and tried this method and still not getting anything back.
Code:$checkform = "
<form method=\"post\" action=\"test.php\">
<table width=\"0%\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\">
<tr>
<td><strong>Messenger Service : </strong></td>
<td><select name=\"ms\">
<option selected>Select</option>
<option value=\"yim\">YIM</option>
<option value=\"msn\">MSN</option>
<option value=\"aim\">AIM</option>
</select></td>
</tr>
<tr>
<td><strong>User ID : </strong></td>
<td><input name=\"id\" type=\"text\"></td>
</tr>
<tr>
<td> </td>
<td><div align=\"right\">
<input type=\"hidden\" name=\"opi\" value=\"docheck\">
<input type=\"reset\" name=\"Reset\" value=\"Reset\">
<input type=\"submit\" name=\"Submit\" value=\"IM Check\">
</div></td>
</tr>
</table>
</form>
";
if ($opi != "docheck") {
echo "$checkform";
} elseif ($opi == "docheck") {
check_status('$ms', '$id', 0);
}
|
Any suggestions would be great. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
montego
Site Admin
![](modules/Forums/images/avatars/0c0adf824792d6d341ef4.gif)
Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Sat Oct 29, 2005 10:02 am |
|
missdanni,
Try echo'ing the variables $ms and $id with something like:
Code:
echo "ms = $ms<br>";
echo "id = $id<br>";
|
Just to see what you are getting. One thing you might want to try is lengthen your variables names a bit. The one that concerns me is the use of "id". Not sure where I read it or if I am even off-base, but it might be getting clobbered.
Also, is this the complete test.php script that you are showing us here? Also, is this what you are calling from the browser the first time? |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
missdanni
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Oct 29, 2005 10:13 am |
|
I renamed ms to mes and id to userid
THEN
I tried adding
echo "mes = $mes<br>";
echo "userid = $userid<br>";
The data is passed into the function but not to check_status()
Now if I use check_status('blah' , 'blah' , 0);
It works fine.
I just can seem to get it to take $mes and $userid |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
montego
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Oct 29, 2005 10:16 am |
|
Oopppsss.... Can't believe I missed it before. Sorry about that. Take the quotes off around $ms and $id so that it looks like this instead:
check_status($ms, $id, 0); |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
missdanni
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Oct 29, 2005 11:31 am |
|
Now im lost ....
When I do this
Code: $mes = 'yim';
$userid = 'theonezion';
check_status($mes, $userid, 0);
|
Everything is fine.
But when I try and do it with a form like above so that you can select $mes and enter $userid it wont work.
Ideas? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
montego
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Oct 29, 2005 11:44 am |
|
Is variable $opi working? Are you getting a value for it? If not, try using the following instead for your variables:
$_POST['opi']
$_POST['mes']
$_POST['userid'] |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
missdanni
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Oct 29, 2005 4:09 pm |
|
This is what im working with currently and it still isnt correctly passing the data.
Code:$checkform = "
<form method=\"post\" action=\"test.php\">
<table width=\"0%\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\">
<tr>
<td><strong>Messenger Service : </strong></td>
<td><select name=\"mes\">
<option selected>Select</option>
<option value=\"yim\">YIM</option>
<option value=\"msn\">MSN</option>
<option value=\"aim\">AIM</option>
</select></td>
</tr>
<tr>
<td><strong>User ID : </strong></td>
<td><input name=\"userid\" type=\"text\"></td>
</tr>
<tr>
<td> </td>
<td><div align=\"right\">
<input type=\"hidden\" name=\"opi\" value=\"docheck\">
<input type=\"reset\" name=\"Reset\" value=\"Reset\">
<input type=\"submit\" name=\"Submit\" value=\"IM Check\">
</div></td>
</tr>
</table>
</form>
";
if ($opi != "docheck") {
echo "$checkform";
} elseif ($opi == "docheck") {
check_status($mes, $userid, 0);
}
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
evaders99
Former Moderator in Good Standing
![](modules/Forums/images/avatars/803d73f6452557b947721.jpg)
Joined: Apr 30, 2004
Posts: 3221
|
Posted:
Sat Oct 29, 2005 11:36 pm |
|
montego maybe right, you may not have register_globals activated. Is this all of the test.php file?
Try
Code:
check_status($_POST['mes'], $_POST['userid'], 0);
|
|
_________________ - Only registered users can see links on this board! Get registered or login! -
Need help? Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
missdanni
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Oct 30, 2005 6:50 am |
|
I tried what you suggested and its still giving me problems.
I believe it has something to do with passing the ' along ..... Im not sure how to correct that one. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
Site Admin/Owner
![](modules/Forums/images/avatars/45030c033f18773153cd2.gif)
Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Sun Oct 30, 2005 8:37 am |
|
If you run this code, do you see the variables being passed?
Code:<?
function check_status($mes, $userid, $var1) {
echo '$mes = '.$mes.'<br />';
echo '$userid = '.$userid;
}
$checkform = "
<form method=\"post\" action=\"test.php\">
<table width=\"0%\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\">
<tr>
<td><strong>Messenger Service : </strong></td>
<td><select name=\"mes\">
<option selected>Select</option>
<option value=\"yim\">YIM</option>
<option value=\"msn\">MSN</option>
<option value=\"aim\">AIM</option>
</select></td>
</tr>
<tr>
<td><strong>User ID : </strong></td>
<td><input name=\"userid\" type=\"text\"></td>
</tr>
<tr>
<td> </td>
<td><div align=\"right\">
<input type=\"hidden\" name=\"opi\" value=\"docheck\">
<input type=\"reset\" name=\"Reset\" value=\"Reset\">
<input type=\"submit\" name=\"Submit\" value=\"IM Check\">
</div></td>
</tr>
</table>
</form>
";
if ($opi != "docheck") {
echo "$checkform";
} elseif ($opi == "docheck") {
check_status($mes, $userid, 0);
}
?>
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|