Jump to content

PJ688

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Everything posted by PJ688

  1. I ran PHPInfo. display_errors and display_startup_errors show as On. Error reporting shows as "30719", whatever that means.
  2. I guess it would help to know that I am working out of CentOS. The same code worked fine in Windows and gave me the errors.
  3. Hello all! Very frustrated PHP newbie here. I am trying to simply get my code to display errors. I have gone into the php.ini file, changed error_reporting to E_ALL, changed display_errors to On, changed display_startup_errors to On, and even added the line ini_set('display_errors', 'on'); to my code. I restarted the server after every change, and still I see no errors. My boss wants me to reach out to the community for answers rather than handing them to me himself. So here I am. Please advise! Thank you very much in advance.
  4. Yeah, I haven't implemented a Submit button yet. As someone above said, I am trying to make something happen when the user selects one of the radios, without having to Submit. If this is impossible, then I will be a sad panda.
  5. Thank you! The error is gone now. Now my if statement doesn't do anything, but I'll keep working on it.
  6. Hello all. I am new to PHP programming and am working on my first project. It's a very simple page that allows the user to send a message via text or email to other users. Unfortunately, I have hit a snag early on and have been unable to overcome it. I am trying to allow the user to select either text or email (via radio input). When this is done, the page is to present a text box with either a 185 or 500 character limit, depending on the selection. This is my code so far: <HTML> <HEAD> <TITLE>SMS System</TITLE> </HEAD> <BODY> <form method = "post"> How will you be sending your message?<br /> <input type = 'radio' name = 'method' value = 'text' checked = 'yes' /> Text to mobile <input type = 'radio' name = 'method' value = 'email' /> Email <br /> <br /> <br /> <?php $selected_radio = $_POST['method']; if($selected_radio == 'text'){ echo "Enter your message below:"; echo "<input type = 'text' id = 'message' name = 'message' maxlength = '185' />"; } ?> </form> </BODY> </HTML> I get an error on the line " $selected_radio = $_POST['method'];" that says "Undefined index: method". However, I clearly defined method as the radio selection. I have tried multiple ways to fix this issue: switching between double quotes and single quotes, using GET instead of POST, separating the code into a PHP file and an HTML file, and changing the name of "method" to something else. None of this has worked. I have read up on several websites, and they all accomplish what I am trying to do using the same technique I am using. If anyone here could be of assistance, I would be most appreciative. Thanks so much!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.