Go Back   Forums > Community Chatterbox > Tech Corner > Programming
Memberlist Forum Rules Search Today's Posts Mark Forums Read
Search Forums:
Click here to use Advanced Search

Reply
 
Thread Tools Display Modes
Old 03-02-2006, 02:37 PM   #11
Reup
10 GOSUB Abandonia
20 GOTO 10
 
Reup's Avatar

 
Join Date: Dec 2004
Location: Eindhoven, Netherlands
Posts: 1,508
Default

Echo the query to see if there are any errors in there. For instance, there are no quotes around the strings you're matching (e.g. login and password)., Afaik if you're doing queries with string literals you have to surround them with single quotes!
Reup is offline                         Send a private message to Reup
Reply With Quote
Old 03-02-2006, 03:01 PM   #12
Kon-Tiki
[BANNED]

 
Join Date: Sep 2004
Location: Dentergem, Belgium
Posts: 1,811
Default

I tried that, too. Anyways, after our fearless leader made some time to explain a couple of misinterpretations (the way the results of mysql_query() are made up, for example), and it now works. Hurray
Kon-Tiki is offline                         Send a private message to Kon-Tiki
Reply With Quote
Old 06-02-2006, 02:24 PM   #13
Kon-Tiki
[BANNED]

 
Join Date: Sep 2004
Location: Dentergem, Belgium
Posts: 1,811
Default

Got another question. This time, I've got these entries in my SQL database that I want to edit. Each entry consists out of 8 fields. I want to list all names of the entries and a checkbox to select them. Submitting the form goes to another page, where the input'll be processed.

This new page shows 7 out of the 8 fields (the 8th being the ID... well, technically the 1st, but you get what I mean). You should be able to alter all 7 fields of each entry. Pressing the Submit-button should process it, running an SQL-query to update the contents.

There's the tricky part. I've tried passing the checkbox array through the processing, so the page'd know which entries to alter, after the alterations've been given in. The problem with this, is that the checkbox array, as I have it now, still has the same look (var_dump gives this:
Quote:
array(3) {[0] => string(1) "1" [1] => string(1) "4" [2] => string(1) "7" }
, which's right. It doesn't update the entries, though, nor does it show them again on the page. Pressing Submit a second time gives NULL for the checkbox array.

Anybody know why it's doing this, and how to fix it? I'm completely stumped. Been trying everything I could think of.
Kon-Tiki is offline                         Send a private message to Kon-Tiki
Reply With Quote
Old 06-02-2006, 06:58 PM   #14
Braindead
Abandonia Homie

 
Join Date: Jun 2004
Location: ,
Posts: 663
Send a message via ICQ to Braindead Send a message via MSN to Braindead
Default

the advantage of md5 is that it's fast & relatively safe, however if you want to be sure to not have security issues, do not encrypt the password but encrypt a login key which you generated yourself .
your table then looks like:
user_id password login_key

your cookie and/or session just contain an md5'ed user_id & login_key

md5 info can be found here: http://www.faqs.org/rfcs/rfc1321
Braindead is offline                         Send a private message to Braindead
Reply With Quote
Old 06-02-2006, 07:19 PM   #15
Mara
Abandonia nerd

 
Join Date: Jan 2006
Location: ,
Posts: 93
Default

Quote:
Originally posted by Reup@Feb 3 2006, 01:29 PM
You MUST put the session_start() as the first thing in your file. THis has to be sent before any headers. As soon as you leave a single empty line or a HTML tag in front of it, you'll get the 'headers already sent' error!

Edit: and you can use the supergloblal $_SESSION['varname'] to store and retreive stuff in your session variable!

I remember spending hours becauce a had jump a line before the <?php
I new about that, but I hadn't seen that stupid backspace

"Pressing Submit a second time gives NULL for the checkbox array."
-> normal. every is erased when you vadid , or refresh the page. Use the sessions if you want to keep it.
Mara is offline                         Send a private message to Mara
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump
 


The current time is 08:21 AM (GMT)

 
Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.