[advanced search]
Results from the most recent live auction are here.
41 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Programming > CODE
User Name
Password

Old 09-06-2005, 05:42 PM   · #1
Coolprogram
NamePros Regular
 
Name: Pete
Location: U.S.A.
Trader Rating: (12)
Join Date: Jul 2005
Posts: 648
NP$: 67.00 (Donate)
Coolprogram has a spectacular aura aboutCoolprogram has a spectacular aura about
PHP problem again??

I keep getting this problem Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/paintman/public_html/signupck.php on line 51 here is the
Code:
$dbservertype='mysql'; $servername='localhost'; // username and password to log onto db server $dbusername='paintman_Admin'; $dbpassword=''; // name of database $dbname='paintman_signup'; connecttodb($servername,$dbname,$dbusername,$dbpas sword); function connecttodb($servername,$dbname,$dbuser,$dbpasswor d) { global $link; $link=mysql_connect ("$servername","$dbuser","$dbpassword"); if(!$link){die("Could not connect to MySQL");} mysql_select_db("$dbname",$link) or die ("could not open db".mysql_error()); } ////////////////////////////// ?> <!doctype html public "-//w3c//dtd html 3.2//en"> <html> <head> <title>Signing Up</title> <meta name="GENERATOR" content="Arachnophilia 4.0"> <meta name="FORMATTER" content="Arachnophilia 4.0"> </head> <body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000"> <? if(isset($todo) and $todo=="post"){ $status = "OK"; $msg=""; // if userid is less than 3 char then status is not ok if (!isset($userid) or strlen($userid) <3){ $msg=$msg"Username should be =3 or more than 3 char length<br>"; $status= "notok";} if mysql_query("SELECT userid FROM plus_signup WHERE userid = '$userid'"))){ $msg=$msg."Userid already exists. Please try another one<BR>"; $status= "NOTOK";} if ( strlen($password) < 3 ){ $msg=$msg."Password must be more than 3 char legth<BR>"; $status= "NOTOK";} if ( $password <> $password2 ){ $msg=$msg."Both passwords are not matching<BR>"; $status= "NOTOK";} if ($agree<>"yes") { $msg=$msg."You must agree to terms and conditions<BR>"; $status= "NOTOK";} if($status<>"OK"){ echo "<font face='Verdana' size='2' color=red>$msg</font><br><input type='button' value='Retry' onClick='history.go(-1)'>"; }else{ $query=mysql_query("insert into plus_signup(userid,password,email,name,sex) values('$userid','$password','$email','$name','$se x')"); echo "<font face='Verdana' size='2' color=green>Welcome, You have successfully signed up</font>"; } } ?> </body> </html>

Can someone help me on this
Thank You,
-Coolprogram


Please register or log-in into NamePros to hide ads
__________________
Your Link Here 10np$ a month Please PM me if you want theses spaces
' '
' '
ProTechGFX.com
Coolprogram is offline   Reply With Quote
Old 09-06-2005, 05:45 PM   · #2
mholt
DNOA Member
 
Name: Matthew Holt
Location: 127.0.0.1
Trader Rating: (75)
Join Date: May 2004
Posts: 4,866
NP$: 17.21 (Donate)
mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future
Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
Could you be so kind and comment line 51? Also, edit your post and change your [ code ] tag to a [ php ] tag.

Thanks.

EDIT: You probably forgot a semicolon at the end of the previous line. Also, I notice your code doesn't start with <?php
__________________
FREE: Help With Code

Includes other technical topics:
programming, development, Windows, domain names, and Internet

Last edited by compuXP : 09-06-2005 at 05:54 PM.
mholt is offline   Reply With Quote
Old 09-06-2005, 08:04 PM   · #3
Crusader
Alert Status Red
 
Crusader's Avatar
 
Name: Anton
Location: Canada
Trader Rating: (24)
Join Date: Aug 2003
Posts: 1,284
NP$: 1252.00 (Donate)
Crusader is just really niceCrusader is just really niceCrusader is just really niceCrusader is just really nice
It might be this.

$msg=$msg"Username should be =3 or more than 3 char length<br>";

$msg=$msg."Username should be =3 or more than 3 char length<br>";

Space things out lad! It's easier to look for errors that way.
__________________

Near Fantastica
| Matthew Good - Hospital Music
>> Do you Frawlik? <<
Crusader is offline   Reply With Quote
Old 09-06-2005, 08:42 PM   · #4
SecondVersion
while ($awake){ code(); }
 
SecondVersion's Avatar
 


Name: Eric
Location: Kentucky
Trader Rating: (140)
Join Date: Mar 2005
Posts: 4,168
NP$: 1359.00 (Donate)
SecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond repute
Member of the Month
MOTM September 2005 Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet
Yes, Indeed. Space things out!!!! Much easier to read and to find any errors! Lol, anyway, I took your code, and not only cleaned it up... fixed your error (I believe)

PHP Code:
<?php

$dbservertype
= 'mysql';
$servername = 'localhost';
$dbusername = 'paintman_Admin';
$dbpassword = '';
$dbname = 'paintman_signup';

connecttodb($servername, $dbname, $dbusername, $dbpassword);
function
connecttodb($servername, $dbname, $dbuser, $dbpassword)
{
global
$link;
$link = mysql_connect("$servername", "$dbuser", "$dbpassword");

if(!
$link)
{
  die(
"Could not connect to MySQL");
}

mysql_select_db("$dbname", $link) or die ("Could not open db " .mysql_error());
}

?>
<!DOCTYPE HTML PUBLIC "-//w3c//dtd html 3.2//en">

<html>

<head>
<title>Signing Up</title>
<meta name="GENERATOR" content="Arachnophilia 4.0">
<meta name="FORMATTER" content="Arachnophilia 4.0">
</head>

<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<?php

if(isset($todo) and $todo == "post")
{

$status = "OK";
$msg = "";

// UserID is less than 3 characters. Status is NOTOK
if (!isset($userid) or strlen($userid) <3)
{
$msg = "Username should be atleast 3 or more characters in length.<br>";
$status= "NOTOK";
}

if (
mysql_query("SELECT userid FROM plus_signup WHERE userid = '$userid'"))
{
$msg = "Userid already exists. Please try another.<BR>";
$status = "NOTOK";
}

if (
strlen($password) < 3 )
{
$msg = "Password must be more than 3 characters in legth.<BR>";
$status = "NOTOK";
}

if (
$password <> $password2 )
{
$msg = "Passwords did not match.<BR>";
$status = "NOTOK";
}

if (
$agree<>"yes")
{
$msg = "You must agree to terms and conditions.<BR>";
$status= "NOTOK";
}

if(
$status<>"OK")
{
echo
"<font face='Verdana' size='2' color=red>$msg</font>
<br>
<input type='button' value='Retry' onClick='history.go(-1)'>"
;
}

else

{

$query = mysql_query("INSERT INTO plus_signup(userid, password, email, name, sex) VALUES('$userid','$password','$email','$name','$se  x')") or die("Could not insert data " .mysql_error());

echo
"<font face='Verdana' size='2' color=green>Welcome, You have successfully signed up.</font>";
}
}
?>

</body>
</html>
__________________

SecondVersion.com - The Personal Blog of SecondVersion
Domain Name Portfolio - Get your free copy. - Version 1.0.1 now available!!
MetaCreator.com - Free Meta Tag Creator

Last edited by SecondVersion : 09-06-2005 at 08:50 PM.
SecondVersion is offline   Reply With Quote
Old 09-07-2005, 06:08 PM   · #5
Coolprogram
NamePros Regular
 
Name: Pete
Location: U.S.A.
Trader Rating: (12)
Join Date: Jul 2005
Posts: 648
NP$: 67.00 (Donate)
Coolprogram has a spectacular aura aboutCoolprogram has a spectacular aura about
There is another problem it says this Could not insert data Table 'paintman_signup.plus_signup' doesn't exist
__________________
Your Link Here 10np$ a month Please PM me if you want theses spaces
' '
' '
ProTechGFX.com
Coolprogram is offline   Reply With Quote
Old 09-07-2005, 06:18 PM   · #6
slantednet
NamePros Regular
 
Trader Rating: (4)
Join Date: Aug 2005
Posts: 214
NP$: 170.00 (Donate)
slantednet is on a distinguished road
I guess the quick answer would be does the database paintman_signup exist and does it contain the table plus_signup?
__________________
OnlineGames.net
slantednet is offline   Reply With Quote
Old 09-07-2005, 06:21 PM   · #7
Coolprogram
NamePros Regular
 
Name: Pete
Location: U.S.A.
Trader Rating: (12)
Join Date: Jul 2005
Posts: 648
NP$: 67.00 (Donate)
Coolprogram has a spectacular aura aboutCoolprogram has a spectacular aura about
The db does but the table plus_signup does not.Okay i will see if i could fix it
__________________
Your Link Here 10np$ a month Please PM me if you want theses spaces
' '
' '
ProTechGFX.com
Coolprogram is offline   Reply With Quote
Old 09-07-2005, 06:37 PM   · #8
slantednet
NamePros Regular
 
Trader Rating: (4)
Join Date: Aug 2005
Posts: 214
NP$: 170.00 (Donate)
slantednet is on a distinguished road
Yeah, either create the table, or check the database to see if you already havea table there and the name is just incorrect in teh script. I don't know if this is a roll-your-own app or something that you purchased/downloaded, so I can't be more help than that...
__________________
OnlineGames.net
slantednet is offline   Reply With Quote
Closed Thread

NamePros is a revenue sharing forum.

Thread Tools

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tutorial: Getting started with PHP (The Basics) deadserious Webmaster Tutorials 60 11-17-2007 11:35 AM
Googlism - What does google think of you? deadserious The Break Room 55 12-15-2005 09:09 AM
MySQL or PHP problem Wildchild22 Website Development 10 07-14-2005 05:24 AM

Site Sponsors
Proof is in the Parking http://www.mobisitetrader.com/ http://www.mobisitetrader.com/
Advertise your business at NamePros
All times are GMT -7. The time now is 03:19 PM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0