Jump to content


Photo

php and mysql help


  • Please log in to reply
3 replies to this topic

#1 zbrahead

zbrahead
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 06 March 2006 - 12:05 PM

i enclose my dataputfm.html and dataputcon.php and if you can make this work i will ermm.... worship you?!?
:) the account details are in the php script and dont try loging into the cPanel as the password is dofferent thankyou.

Dataputfm.html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#000000" text="#CCCCCC">
<p>&nbsp;</p><form name="form1" method="post" action="dataputcon.php">
  <p>Link (to comply with IMPACT Games standards MUST end in .swf): 
    <input name="link" type="text" id="link">
  </p>
  <p>name: 
    <input name="name" type="text" id="name">
  </p>
  <p>comments : 
    <input name="comments" type="text" id="comments3">
  </p>
  <p> <input type="submit" name="Submit" value="Lock 'n' load game">
    
  </p>
  <p>&nbsp;</p>
</form>
</body>
</html>

Dataputcon.php:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#000000">
<?php
$link = $_POST['link']
$name = $_POST['name']
$comm = $_POST['comments']
#mySQL connection

$conn = mysql_connect( "localhost" , "ricfo0i1_ricfon" , "polionum" )
              or die( "no mysql" )
# Database connection
$rs = mysql_select_db( "gamelist" , $conn ) 
        or die( "no DB" );

#Form query
#$sql = "insert into list ( "name" , "comments" ) values ( "$a" , "$comm" ) ";
$sql = 'INSERT INTO `list` (`id`, `name`, `comments`) VALUES (\'\', \'<a href="$link" target="_top">$name</a>\', \'$comm\')';
#run query

$rs = mysql_query( $sql , $conn )
    or die( "query error" );
    
 echo( "putted succesfully" )



?>
</body>
</html>


#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 06 March 2006 - 12:15 PM

Do we get a clue? What doesn't work? Do you get an error? What's the error message? Maybe this will help in the interim:
$sql = "INSERT INTO `list` (id, name, link, comments) VALUES ('', '$name', '$link', '$comm') ";

Legend has it that reading the manual never killed anyone.
My site

#3 Prank

Prank
  • Members
  • PipPip
  • Member
  • 25 posts
  • LocationSydney, AUS

Posted 06 March 2006 - 12:16 PM

couple of syntactical errors...

Try this;

<?php
$link = $_POST['link'];
$name = $_POST['name'];
$comm = $_POST['comments'];
#mySQL connection

$conn = mysql_connect( "localhost" , "ricfo0i1_ricfon" , "polionum" )
              or die( "no mysql" );

# Database connection
$rs = mysql_select_db( "gamelist" , $conn )
        or die( "no DB" );

#Form query
#$sql = "insert into list ( "name" , "comments" ) values ( "$a" , "$comm" ) ";
$sql = 'INSERT INTO `list` (`id`, `name`, `comments`) VALUES (\'\', \'<a href="$link" target="_top">$name</a>\', \'$comm\')';
#run query

$rs = mysql_query( $sql , $conn )
    or die( "query error" );

echo( "putted succesfully" );



?>

If no go, report the error.

Oh, and what AndyB said.

Christian
The way to a mans stomach is through his heart.

#4 zbrahead

zbrahead
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 06 March 2006 - 12:39 PM

Thanks For replying to my horrible post so now i have more tiome i would like to say please and thankyou and that there was no error




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users