Topic: Php Help

I want to do something like this...

If you goto a something like this for example
http://www.yourname.com/check.php?user= … ass=gdhdgh

then it would add newera70 and gdhdgh into a database...

i tried it with this code...

//config.php
<?php
$dbhost = "localhost";
$dbuser = "thrice_test";
$dbpass = "test";
$dbname = "thrice_test";
?>

and

//check.php
<?php
  include("config.php");
  $User = $_GET['user'];
  $Pass = $_GET['pass'];
    
    if($User != "" && $Pass != "")
    {         
                mysql_connect("$dbhost", "$dbuser", "$dbpass") or die ('I cannot connect to the database because: ' . mysql_error());
    mysql_select_db("$dbname");
    mysql_query("INSERT INTO pkbot WHERE user = '$User' AND pass = '$Pass'");
    }
    else if($User == "" && $Pass == "")
    {
    exit();
    }
?>

someone please help....

- Newera70

Re: Php Help

You made a comment outside of the PHP tags wink
Your insert query structure is wrong
should be

insert into [table] ([column], [column]) values ([value], [value])

Re: Php Help

those comments were just for posting this... what would i put for the insert into then can u find out by looking at my code?

Re: Php Help

mysql_query("INSERT INTO pkbot SET user = '$User' AND pass = '$Pass'");
// or
mysql_query("INSERT INTO pkbot (user, pass) VALUES( user = '$User' AND pass = '$Pass')");
// or maybe you meant
$query = mysql_query("SELECT * FROM pkbot WHERE user='$User' AND pass='$Pass'");
Indocron
$theQuestion = (2*b) || !(2*b);