You are here: Scripting error « PHP Programming Language « IT news, forums, messages
Scripting error

Posted by steve02a on 12/22/05 18:41

I have a simple html form built that a user puts name, company,
address..blah..blah, you know - and it dumps it all in a db I created
in MySQL.

Below is my php script:

<?php

if (strlen($name) > 2) {

$dbh=mysql_connect ("localhost", "reseller", "PASSWORD HERE") or die
('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("autonomi_reseller ");

$date = time();

$insertq = "INSERT INTO apply SET first_name = '$first_name', last_name
= '$last_name', email = '$email', company = '$company', address1 =
'$address1', address2 = '$address2', city = '$city', state_province =
'$state_province', zip_or_postalcode = '$zip_or_postalcode', phone =
'$phone'";
mysql_query($insertq) or die (mysql_error());

echo '<html><head><title>Redirect</title><script language="javascript">
<!--

location.redirect("http://url.com here");

-->
</script>
';
}

?>
--------------------------------------------------------------------

Whne I execute the script after I filled in all the info on the webpage
form, I get this error:

Parse error: parse error, unexpected $ in
/home/autonomi/public_html/php/app.php on line 23

What am I missing in my php script? It's driving me nuts trying to
figure it out. Thanks in advance.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация