Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.