Page 1 of 1

problems with passing variables through command line

Posted: Thu May 08, 2003 3:38 pm
by muab
hiho =)

i wrote a web server and want to make it supporting php (as cgi for now).
now it works fine when it should interprete normal php with:

php.exe site\test.php

but if i want to pass eg stuff that was entered in some input form i have a problem:
the browser sends "test2.php?value1=suc&value2=cess"

now how could i "translate" that into command line? either the variables are "not defined" in test2.php or there is simply no output at all =(

so where is the trick?

thx in advance
muaB

Posted: Thu May 08, 2003 3:46 pm
by twigletmac
What's your PHP code look like?

Mac

Posted: Thu May 08, 2003 4:08 pm
by muab
actually i try:

the starting page:

<FORM ACTION="check.php" METHOD="GET" name="form1">
<p align="center">
User:<BR><input type="text" size="25" maxlength="50" name="name"><BR>
Passwort:<BR><input type="password" maxlength="50" name="passwort"><BR>
<input type="submit" value="Einloggen">
</form>

giving the values to check.php:

<?
$name=strtolower($name);
$passwort=strtolower($passwort);
$datei=fopen("pwd.dat.php","r");
while(feof($datei)==0):
$nme=chop(fgets($datei,110));
$pwd=chop(fgets($datei,110));
$seite=chop(fgets($datei,500));
if ($name==$nme):
if ($passwort==$pwd)
header("location: ".$seite."");
endif;
endwhile;
fclose($datei);
?>
User oder Passwort falsch!

but i dont want to change my code (well, if something wouldnt work on any server i would hehe), i want to change the behavior of my server to become a "normal" php server.

thx
muaB

Posted: Thu May 08, 2003 9:56 pm
by volka
same matter: viewtopic.php?t=8595 ;)