This is a discussion on "question on Variables" within the PHP Forum section. This forum, and the thread "question on Variables are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
question on Variables
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
||||
|
question on Variables
would this work if i used Variables to replace the 'username' and 'password' here ?
thank you
Last Blog Entry: Basic Advice for newbies (Feb 1st, 2008)
Last edited by saltedm8; Oct 8th, 2007 at 19:21. |
|
|
|
||||
|
Re: question on Variables
You got it! That not only works, that is the whole point of using PHP!!!
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
||||
|
Re: question on Variables
thank you, i just did not know if it would literly insert '$username' and '$password'
so how would i change the values from a form ?
Last Blog Entry: Basic Advice for newbies (Feb 1st, 2008)
Last edited by saltedm8; Oct 8th, 2007 at 19:49. |
|
||||
|
Re: question on Variables
Here's a little modified chunk of the login script I use on my site. Feel free to ask about anything you don't understand:
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
||||
|
Re: question on Variables
once the form is submitted is the value then stored for good in the variable? ( unless changed ) - simply because i have taken that a variable has to = something, what does it = ?
where is the value stored ?
Last Blog Entry: Basic Advice for newbies (Feb 1st, 2008)
Last edited by saltedm8; Oct 8th, 2007 at 20:11. |
|
||||
|
Re: question on Variables
I'm not too sure what you mean,
but once the form is submitted and the variable is put into the database, it will stay in the database. The php variable will be lost when that particular script is ended. Hope that is what you were asking.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
||||
|
Re: question on Variables
ahhh, i think i have got it,
so i need to post the form data to the database and the variable will recover it UPDATE 'members' etc
Last Blog Entry: Basic Advice for newbies (Feb 1st, 2008)
|
|
||||
|
Re: question on Variables
Quote:
|
|
||||
|
Re: question on Variables
does this look right ?
Last Blog Entry: Basic Advice for newbies (Feb 1st, 2008)
|
|
||||
|
Re: question on Variables
This is how I do it and you need to specify which record is getting updated (after the WHERE clause)
|
|
||||
|
Re: question on Variables
What you're doing there is very dangerous and can and will be exploited by SQL injection. (Google for that if you're not sure SQL injection is). ALWAYS check user input before you use it in an SQL query!!!!
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
||||
|
Re: question on Variables
Quote:
Quote:
__________________
The Net is Dying | Fan Rage | We are Battlefield heroes - BFH Forum Vanilla Source - Vanilla Help, and mods
Last Blog Entry: Whats your Niche? (Jun 10th, 2008)
|
|
||||
|
Re: question on Variables
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using Variables in ASP with LightBox | LeeNic | Classic ASP | 4 | Mar 18th, 2008 15:12 |
| Multiplying variables... | Germaris | Flash & Multimedia Forum | 2 | Feb 27th, 2008 23:26 |
| Form - variables not going through | comaiwat | JavaScript Forum | 3 | Oct 24th, 2007 13:53 |
| Variables!! | bionics | PHP Forum | 6 | Apr 25th, 2006 15:39 |
| Get URL and use variables | JamieH | PHP Forum | 2 | Jan 1st, 2006 03:13 |