Jump to content

php and mysql help


zbrahead

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]
Link to comment
https://forums.phpfreaks.com/topic/4201-php-and-mysql-help/
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
Link to comment
https://forums.phpfreaks.com/topic/4201-php-and-mysql-help/#findComment-14603
Share on other sites

Archived

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

×
×
  • Create New...

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.