Page 1 of 1

Dating Website

Posted: Tue Feb 24, 2004 3:53 pm
by sleekfx
edit patrikG: too many dots in the thread-subject. Please refrain from doing that

Hi there im from Ireland and im 22 and im a third year Computing with Multimedia student. For my third year project i am creating a dating website.

Now i am not too familar with MYSQL or PHP but i am learning rapidly enough. However when i wrote up a program to send data to a table on my database the dammed thing keeps giving me error messages and i dont know why?

I am using Foxserve as my local host and MYSQLadmin or whatever its called but it just wont work. Take a look and id really appreciate the help.

Des,

Code: Select all

<HTML>
<HEAD>
<TITLE>Putting data</TITLE>
</HEAD>
<BODY>
<?php
/* This program enters news items into a database */

if(isset($submit)):

$db = mysql_connect ("localhost", "root");

mysql_select_db ("php", $db);

$date = date("Y-m-d");

$sql = "INSERT INTO news

VALUES (NULL, '$heading','$body', '$date',
'$auth', '$auth_email');

mysql_query($sql);

print("<h2>The data has been entered.</h2>");
print("<b>You can adda nother news story below</b>");

endif;
?>

<h1>Enter your news item into the database</h1>
<form action="data_in.php" method="post">
Name:<br> <input type ="text" name="auth">
Email:<br> <input type ="text" name="auth_email">
Heading:<br> <input type ="text" name="auth">
News:<br> <input type ="text" name="body">

<input type="submit" name"submit" value="Submit News!">
</form>
</body>
</html>

This is the error message im getting off one of the lines

"Parse error: parse error, unexpected '>' in C:\FoxServ\www\data_in.php on line 24"

Weirdan | Help us, help you. Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Tue Feb 24, 2004 4:06 pm
by ilovetoast
The parse error is due to line 20

change:

Code: Select all

'$auth', '$auth_email');
to:

Code: Select all

'$auth', '$auth_email')";
peace

Posted: Tue Feb 24, 2004 5:37 pm
by AVATAr
Try using some color code!!! and you will see your error inmediately.
See what ilovetoast said... the color of the code after the line of "$sql = "INSERT INTO news...."

Code: Select all

<?php
<HTML>
<HEAD>
<TITLE>Putting data</TITLE>
</HEAD>
<BODY>
<?php
/* This program enters news items into a database */

if(isset($submit)):

$db = mysql_connect ("localhost", "root");

mysql_select_db ("php", $db);

$date = date("Y-m-d");

$sql = "INSERT INTO news

VALUES (NULL, '$heading','$body', '$date',
'$auth', '$auth_email');

mysql_query($sql);

print("<h2>The data has been entered.</h2>");
print("<b>You can adda nother news story below</b>");

endif;
?>

<h1>Enter your news item into the database</h1>
<form action="data_in.php" method="post">
Name:<br> <input type ="text" name="auth">
Email:<br> <input type ="text" name="auth_email">
Heading:<br> <input type ="text" name="auth">
News:<br> <input type ="text" name="body">

<input type="submit" name"submit" value="Submit News!">
</form>
</body>
</html>

?>
if you change it:

Code: Select all

<?php
<HTML>
<HEAD>
<TITLE>Putting data</TITLE>
</HEAD>
<BODY>
<?php
/* This program enters news items into a database */

if(isset($submit)):

$db = mysql_connect ("localhost", "root");

mysql_select_db ("php", $db);

$date = date("Y-m-d");

$sql = "INSERT INTO news
VALUES (NULL, '$heading','$body', '$date',
'$auth', '$auth_email')";

mysql_query($sql);

print("<h2>The data has been entered.</h2>");
print("<b>You can adda nother news story below</b>");

endif;
?>

<h1>Enter your news item into the database</h1>
<form action="data_in.php" method="post">
Name:<br> <input type ="text" name="auth">
Email:<br> <input type ="text" name="auth_email">
Heading:<br> <input type ="text" name="auth">
News:<br> <input type ="text" name="body">

<input type="submit" name"submit" value="Submit News!">
</form>
</body>
</html>

?>
do you see the diference?

Posted: Fri Nov 12, 2004 12:41 pm
by ramagates
I am planning to put up a dating site for Sri Lankans. Any one help me? mail me to lankaserver@msn.com.