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
problems with passing variables through command line
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
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
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
same matter: viewtopic.php?t=8595 