Get Paid to Participate     Twitter     Facebook     Google+
Hosting Discussion
 

forgot password?


Reply


Old
  Post #1 (permalink)   07-16-2004, 09:17 AM
HD Guru
 
Join Date: Oct 2003
Location: Michigan, USA
Posts: 553

Status: Vovex Technology is offline
Ok so today I am working on making my form data be imported into my mysql database that I setup. Yet when I run the addrequest.php I get the following error.


Quote:
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/aatechni/public_html/addrequest.php on line 3

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/aatechni/public_html/addrequest.php on line 4

Parse error: parse error in /home/aatechni/public_html/addrequest.php on line 4

Here is the code for addrequest.php
PHP Code:
<?

$username
="******";
$password="******";
$database="******";    

$firstname=addslashes($_POST['firstname']);
$lastname=addslashes($_POST['lastname']);
$company=addslashes($_POST['company']);
$phonenumber=addslashes($_POST['phonenumber']);
$address1=addslashes($_POST['address1']);
$address2=addslashes($_POST['address2']);
$city=addslashes($_POST['city']);
$state=addslashes($_POST['state']);
$zipcode=addslashes($_POST['zipcode']);
$brand=addslashes($_POST['brand']);
$model=addslashes($_POST['model']);
$description=addslashes($_POST['description']);
$os=addslashes($_POST['os']);
$urgency=addslashes($_POST['urgency']);

$regdate date('m d, Y');
$status="new";

mysql_connect(localhost,$username,$password);
@
mysql_select_db($database) or die( "Unable to select database");

$query("INSERT INTO users (firstname, lastname, company, phonenumber, address1, address2, city, state, zipcode, brand, model, os, urgency, regdate, status) VALUES ('$firstname[0]','$lastname[1]','$company[2]','$phonenumber[3]','$address1[4]','$address2[5]','$city[6]','$state[7]','$zipcode[8]','$brand[9]','$model[10]','$description[11]','$os[12]','$urgency[13]','$regdate[14]','$status[15]')");

mysql_close();

?>
You can view the form by visiting:
http://www.aatechnical.com/?pid=request


Please help. I need to finish this peice of code before I can start working on the next. Thanks in advance.
__________________
Jonathan
 
 
 


Old
  Post #2 (permalink)   07-16-2004, 12:37 PM
HD Guru
 
turnkey's Avatar
 
Join Date: Dec 2003
Location: Cary, NC
Posts: 588
Send a message via Yahoo to turnkey

Status: turnkey is offline
At the top try changing

Code:
 <?
to

Code:
<?php
__________________
Turnkey Resellers
www.turnkeyresellers.com
Reseller Hosting and PHP Programming
 
 
 


Old
  Post #3 (permalink)   07-16-2004, 12:40 PM
HD Guru
 
turnkey's Avatar
 
Join Date: Dec 2003
Location: Cary, NC
Posts: 588
Send a message via Yahoo to turnkey

Status: turnkey is offline
Also, make sure these names (username, etc) are not reserved. Check your info.php

Code:
<?php
phpinfo();
?>
Try changing the varable names to like $user_name, $db, etc...

The parse error is complaining on like 3 and 4 so that is where I would start.
__________________
Turnkey Resellers
www.turnkeyresellers.com
Reseller Hosting and PHP Programming
 
 
 


Old
  Post #4 (permalink)   07-16-2004, 01:00 PM
HD Guru
 
Join Date: Oct 2003
Location: Michigan, USA
Posts: 553

Status: Vovex Technology is offline
I'll try those out when I get home. THanks for the help Turnkey I will let you know what the results are..... as for now Im about to throw the damn computer out the window
__________________
Jonathan
 
 
 


Old
  Post #5 (permalink)   07-16-2004, 02:01 PM
HD Guru
 
Join Date: Oct 2003
Location: Michigan, USA
Posts: 553

Status: Vovex Technology is offline
Ok I made a few changes in the code so now I dont get those ASCI=92 errors. Now I receive a parse error on LINE 29. I have marked line 29 in red.

Code:
<?php

$db_username="aatechni_client";
$db_password="jk38921";
$db_name="aatechni_client";

$firstname=$_POST['firstname'];
$lastname=$_POST['lastname'];
$company=$_POST['company'];
$phonenumber=$_POST['phonenumber'];
$address1=$_POST['address1'];
$address2=$_POST['address2'];
$city=$_POST['city'];
$state=$_POST['state'];
$zipcode=$_POST['zipcode'];
$brand=$_POST['brand'];
$model=$_POST['model'];
$description=$_POST['description'];
$os=$_POST['os'];
$urgency=$_POST['urgency'];

$regdate = date('m d, Y');
$status="new";

mysql_connect(localhost,$db_username,$db_password);
@mysql_select_db($db_name) or die( "Unable to select database");

$query = "INSERT INTO users VALUES
(",'$firstname','$lastname','$company','$phonenumber','$address1','$address2','$city','$state','$zipcode','$brand','$model','$os','$urgency','$regdate','$staus')";
mysql_query($query);

mysql_close();
?>
__________________
Jonathan
 
 
 


Old
  Post #6 (permalink)   07-16-2004, 03:21 PM
HD Guru
 
Join Date: Oct 2003
Posts: 579
Send a message via AIM to Francisco Send a message via Yahoo to Francisco

Status: Francisco is offline
Change '$staus to '$status
 
 
 


Old
  Post #7 (permalink)   07-19-2004, 07:02 AM
HD Guru
 
Join Date: Oct 2003
Location: Michigan, USA
Posts: 553

Status: Vovex Technology is offline
Francisco I love you man.... hehe it was that mispell and I have my " and ( in the wrong places. Thanks
__________________
Jonathan
 
 
 
Reply

Thread Tools

New Post New Post   Old Post Old Post
Posting Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Sponsored By: