Results 1 to 13 of 13

Thread: [RESOLVED] $_POST[''] or not to $_POST['']

Hybrid View

  1. #1
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: $_POST[''] or not to $_POST['']

    Quote Originally Posted by LingoOutsider View Post
    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" 
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  2. #2
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: $_POST[''] or not to $_POST['']

    Quote Originally Posted by visualAd View Post
    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.


    Quote Originally Posted by visualAd View Post
    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
  •  



Click Here to Expand Forum to Full Width