![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Jul 2008
Posts: 47
Rep Power: 0
![]() |
need help getting value from textbox
ok i put a textbox on my site and im trying to get the value from it when it can log when a user uploads
my html code for the textbox looks like this <input type="text" name="name" id="name" /> and the php for what i added looks like this $Name = $_GET['name']; i used get because when i used POST it would bypass the null testing and just upload null or not but then i added this to test null if ($Name === NULL) { print ("$Name"); die ("You need to enter your name if you want credit for the upload."); } this made it so even if there was a name in the textbox it didnt read it im completely stumped btw if you havent noticed im completely new to php |
|
|
|
|
|
#2 |
|
King of Portal
|
Re: need help getting value from textbox
You were fine using $_POST. However, what you need to keep in mind is that when the value is submitted. An empty string is still a string. If you want to test for an empty string that was passed using $_POST then you could do something like:
if(strlen(trim($_POST['name'])) == 0) In that case it says if the string is of length 0 then it's no good. The trim function removes all whitespace characters from the left and right side of a string.
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Jul 2008
Posts: 47
Rep Power: 0
![]() |
Re: need help getting value from textbox
ill give that a try
|
|
|
|
|
|
#4 |
|
Programmer
Join Date: Jul 2008
Posts: 47
Rep Power: 0
![]() |
Re: need help getting value from textbox
it worked
thanks |
|
|
|
|
|
#5 |
|
Programmer
Join Date: Jul 2008
Posts: 47
Rep Power: 0
![]() |
Re: need help getting value from textbox
hm now it wont actually upload and i didnt touch any of that code
so im completely stumped...it says it was successfully uploaded but when i check my ftp nothing is thereany ideas? |
|
|
|
|
|
#6 |
|
Programming Guru
![]() ![]() ![]() |
Re: need help getting value from textbox
You may want to show us the upload code. We cannot help you debug if we cannot see it.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#7 |
|
Programmer
Join Date: Jul 2008
Posts: 47
Rep Power: 0
![]() |
Re: need help getting value from textbox
well....for some reason it just started working outta nowhere but thanks for all the help guys
![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| textbox in datalist | ktsirig | ASP.NET | 0 | Dec 14th, 2007 10:38 AM |
| Inserting text into a textbox | 357mag | C# | 8 | May 19th, 2007 7:35 PM |
| Winapi get textbox | jayme | C++ | 6 | Jan 16th, 2006 7:02 PM |
| Problems with Rich Textbox. | mikaoj | Visual Basic | 3 | Sep 7th, 2005 2:12 PM |
| Concatinating values from drop-down into textbox | crmpicco | JavaScript and Client-Side Browser Scripting | 1 | Jul 1st, 2005 7:18 AM |