Jump to content

Archived

This topic is now archived and is closed to further replies.

zbrahead

php and mysql help

Recommended Posts

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:
[code]<!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>
[/code]

Dataputcon.php:
[code]<!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>
[/code]

Share this post


Link to post
Share on other sites
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:
[code]$sql = "INSERT INTO `list` (id, name, link, comments) VALUES ('', '$name', '$link', '$comm') ";[/code]

Share this post


Link to post
Share on other sites
couple of syntactical errors...

Try this;

[code]
<?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" );



?>
[/code]

If no go, report the error.

Oh, and what AndyB said.

Christian

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.