View Single Post
Old 07-20-2002, 01:00 AM   #8 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,720
redhead is on a distinguished road
Re: One little problem with the script

Quote:
Originally posted by Geetazz
I only had a chance to try the myaccount script because I could not get it to work. This is what I have and the error says phase error on line 22. Which is where I have query. Did I put the stuff that redhead said to put at the end in the wrong place?

PHP Code:
$query "SELECT username, kennel, dspoints, job, email FROM member/"
$rows=mysql_fetch_array($result)
$rows[usernamekenneldspointsjobemail]
echo 

$result = mysql_query($query) ; 
Ok, this last part is just plain wrong.. (Is it a typo with the / after "member" ? )
Remove the $rows[username,kennel,dspoints,job,email]
and place the $result=mysqlquery($query); outside the echo " part.
Quote:
PHP Code:
Your Username is $username<br>*Your kennel name is $kennel <br
Here you use it like:
Your Username is $row[username]<br>*Your kennel name is $row[kennel]<br> That was how I ment for you to use either the $row[identifyer] or $row->IDENTIFYER Same goes for the rest of the refferences in the page.
Quote:
PHP Code:
You have $dspoints<br>Your job is $job <br>*Your email is $email <p><p>"
Here you can change the information that has star<p> 
<form action="
checkall.php method'past'
Why is there a " infront of checkall.php ?? There are still some missplaced " in this part, that will confuse echo
Quote:
PHP Code:
Kennel Name <input type='text' name='kennel' 
size='25' maxlength='25' value='$kennel'
<
p>Email<input type'text' name='email' 
size='25'=maxlength='25' value='$kennel'> <p>Email<input type='text' name='email' size='25' maxlength='25' value='$email'> { if (!ereg("^.+@.\..+$\",$email)); 
or die ("
couldnt execute query."); 
echo "
member info has been updated<br>"; 

?> 
Why are you using a if(!ereg()) statement within your echo string ? And where is the closing "; to indicate theres no more for echo to display ? And how come most of the closing " escaped ?
I usualy use ' for every intended " that is used for settings and the like, and try _not_ to use too many " in my text. If I need to use it, then I make sure its escaped.

I would move the if(!ereg()) up just befor the echo starts, and use $row[email] in the test condition.. That way you would've made sure all the conditions are met, befor trying to display anything.

Any way, since the $query parsed to mysql_query() is only a fetching request, I very much doubt that the echo "member info has been updated<br>"; statement will be true.
But happy hacking
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote