SitePoint Sponsor |
|
User Tag List
Results 1 to 11 of 11
-
Aug 13, 2001, 16:42 #1
- Join Date
- Dec 2000
- Posts
- 528
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Controling Access Using PHP & MySQL
Hi all,
I used Kevin Yank's article, Managing Users with PHP Sessions and MySQL to make a script that controls access to a certain area of my site.
However, I always get the following error message:Parse error: parse error in /home/corby/justforwebmasters-www/authors/new.php on line 142
Any ideas?
Thanks,
CorbbCorbb O'Connor
Looking for quality website design or database programming?
Contact me for more information and a FREE quote!
-
Aug 13, 2001, 16:46 #2
- Join Date
- Aug 2000
- Location
- San Diego, CA
- Posts
- 5,460
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Could you post all that code into a .phps file, just copy the code into that file and name it wit ha .phps extension, that way we can see your color-highlighted code. Its sort of hard to read in the textareas, also you may want to convert your scripts to a {} structure instead of using colons for your if clauses. It will be easier to debug that way.
Please don't PM me with questions.
Use the forums, that is what they are here for.
-
Aug 13, 2001, 16:54 #3
- Join Date
- Dec 2000
- Posts
- 528
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Freddy,
That won't work because my server parses all files for PHP.
It's in a .zip file now. http://www.justforwebmasters.com/authorscripts.zip
-CorbbCorbb O'Connor
Looking for quality website design or database programming?
Contact me for more information and a FREE quote!
-
Aug 13, 2001, 16:56 #4
- Join Date
- Aug 2000
- Location
- San Diego, CA
- Posts
- 5,460
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Did you convert the if else clauses to brackets style instead of colon style?
Please don't PM me with questions.
Use the forums, that is what they are here for.
-
Aug 13, 2001, 16:59 #5
- Join Date
- Dec 2000
- Posts
- 528
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
freddy,
I used most of the code Kev used in his article.
What do you mean by, "convert the if else clauses to brackets style instead of colon style"?
I'm not too advanced at PHP.
Thanks for your help,
CorbbCorbb O'Connor
Looking for quality website design or database programming?
Contact me for more information and a FREE quote!
-
Aug 13, 2001, 17:04 #6
- Join Date
- Aug 2000
- Location
- San Diego, CA
- Posts
- 5,460
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
What I mean is you have thing like
PHP Code:if():
else():
endif;
From the bottom of the file to close the else: clause, this is why Isaid to change it to a style like
PHP Code:if {
}
else {
}
Please don't PM me with questions.
Use the forums, that is what they are here for.
-
Aug 13, 2001, 17:15 #7
- Join Date
- Dec 2000
- Posts
- 528
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Freddy,
Thanks for your help.
The script displays now, except it just reloads the form and doesn't add the entries to the database.
The .zip file has been updated.Corbb O'Connor
Looking for quality website design or database programming?
Contact me for more information and a FREE quote!
-
Aug 13, 2001, 17:23 #8
- Join Date
- Aug 2000
- Location
- San Diego, CA
- Posts
- 5,460
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I guess you aren't gonna change those control structures
. The first reason its not working is you are checking for the existence of $submitok on line 6, $submitok never exists even when the form is submitted since your submit button has no name
PHP Code:<input type="submit" value="Add">
PHP Code:<input type="submit" name="submitok" value="Add">
Please don't PM me with questions.
Use the forums, that is what they are here for.
-
Aug 13, 2001, 17:37 #9
- Join Date
- Dec 2000
- Posts
- 528
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Freddy,
Thank your help. It works now!
-A very happy CorbbCorbb O'Connor
Looking for quality website design or database programming?
Contact me for more information and a FREE quote!
-
Aug 13, 2001, 17:38 #10
- Join Date
- Aug 2000
- Location
- San Diego, CA
- Posts
- 5,460
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Would you at least humor me and promise me that you are gonna change those colons to brackets?
Please don't PM me with questions.
Use the forums, that is what they are here for.
-
Aug 13, 2001, 17:41 #11
- Join Date
- Dec 2000
- Posts
- 528
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
If I come accross another script, I'll change 'em before coming to you
Thanks again for your help,
CorbbCorbb O'Connor
Looking for quality website design or database programming?
Contact me for more information and a FREE quote!
Bookmarks