Einzelnen Beitrag anzeigen

Delphiturbo
(Gast)

n/a Beiträge
 
#23

Re: if($name=="") {xxxx} funktioniert nicht ?

  Alt 12. Jun 2008, 14:59
Zitat von CK_CK:
@Delphiturbo: Also so wird das nichts... Poste mal deinen gesamten Code (oder häng' ihn in den Anhang). Dann kann man den Fehler auch besser finden

Chris
Delphi-Quellcode:
<?php

    $cona = @mysql_connect("localhost","xxxx","yyyy")
        or die(mysql_error());

    $cona_db = mysql_select_db("xxxx", $cona)
        or die(mysql_error());


$name = $_GET['name'];

$sql="SELECT * FROM tabelle1 WHERE name = '$name'";
$result = mysql_query($sql);
if( mysql_num_rows( mysql_query( "select * from tabelle1 where name='$name'" ) ) <> 0 )
{

$result = mysql_query("SELECT name FROM tabelle1 order by name DESC LIMIT 1")
        or die(mysql_error());
}

       
?>

<html>
<title>Test1</title>
<body>
<form action="#" method="post" name="formular">
<?php

while($row = mysql_fetch_object($result))
{
?>



<input type="text" name="name" size="50" value="<?php echo  $_GET['name'];?>"></p>

<tr>
<td align="center"><input type="submit" name="submit" value="senen"></td>
</tr>
</table>

if (empty($name))

{
header ("Location: http://www.google.de");

}


<?php
}

?>
</form>
</body>
</html>
Die Seite von google wird aufgerufen ohne zu Klicken auf Senden !
  Mit Zitat antworten Zitat