|
-
Aug 9th, 2009, 11:56 AM
#1
Re: $_POST[''] or not to $_POST['']
 Originally Posted by LingoOutsider
Thanks for your help and sorry for the vague question.
your corret in that my buttons are in conflict. and my samples form should have been set to get although it could work with post.
1st... A button appears in the URL as being submited when pressed.
Then... The text from the textarea appears in the URL as well as the previously pressed button when the enter button is pressed inside the textarea.
so if I use $_GET and I think $_POST it shows as submited even though It hasn't.
Having two submit buttons does not mean that they are in conflict; as long as you realise that only one button can be used to submit the form in any one request and you require your application to behave differently depending on which button is pressed, it is fine. The Google search enginge has two submit buttons "Search" and "I'm Feeling Lucky".
When testing, it is best to use the Isset() construct rather than simply testing weather or not it is "true". The fact you are doing that also indicates that you have error_reporting set to something other than "E_ALL". During the development of your script or application, it is essential that you set error reporting to its maximum level. You can do this by changing php.ini:
Code:
error_reporting = E_ALL
Or set it at the top of the script:
PHP Code:
error_reporting(E_ALL);
Doing this will help with the debugging process because it will spit out a notice every time you try and read a variable that was never set. A great way of filtering out typos and encouraging secure coding by ensuring that any variable you intend to use is explicitly set first in the code:
PHP Code:
$myvar = "";
$mayvar += "Hello"
-
Aug 9th, 2009, 08:10 PM
#2
Re: $_POST[''] or not to $_POST['']
 Originally Posted by visualAd
If you are not sure what the original poster is asking, either leave to to someone else to answer or ask the OP to clarify. Your post just confused the situation 
That's what I did but after I had already posted the code example! By the time I thought about the question someone had already replied to the thread.
 Originally Posted by visualAd
Having two submit buttons does not mean that they are in conflict;
Ah ok, I was thinking that just because it was a submit button that it was type controlling it.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|