Jump to content

Search the Community

Showing results for tags 'radio'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 3 results

  1. Hello all. I have tried to figure out why I can't make a certain part of my code sticky. I am attempting to save the user's input for the radio button section. I am using a foreach loop for everything in my array. When I try to use if isset, it returns the last item in the array instead of what was selected by the user. Here is the code: <?php //Creating foreach loop for magazine selection foreach ($magSubs as $mag => $SUB_PRICE) { echo "<input type='radio' name='magtype' value='$mag' />$mag $$SUB_PRICE per month<br> "; } ?> Again, I want to make this part sticky.
  2. I have been trying to just simply add whatever the user picks from the radio form to the field "number" in their specified user table. I cannot get it working. Any ideas on what is wrong? It does not add the choice into the specified field, it leaves it null <?php if(isset($_POST['submit'])) { $number=$_POST['number']; if($number!="") { $query=mysql_query("UPDATE users SET number = '$number' WHERE name = '".$user->name."';"); if($query) { header('Location: /me'); } else { $error_message = '<font color="red"><strong>Please choose a number.</strong></font><br /><br />'; } } } ?> <form method="post" action="post"> <input type="radio" name="number" value="1" />1 <input type="radio" name="number" value="2" />2 <input type="radio" name="number" value="3" />3 <input type="submit" name="submit" /> </form>
  3. Hey fellas, I recently decided to start my personal database on monsters in a game and have a website with forms etc where I can enter new monsters. Now I've made a start, but I'm getting a line 15 error when trying to execute the form without having an input button ticket. The file including the form that's related to the error (newmonster.php): </tr><tr> <td>Attribute:</td> <td><input type="radio" name="attribute" value="dark" />Dark <input type="radio" name="attribute" value="earth" />Earth <input type="radio" name="attribute" value="fire" />Fire <input type="radio" name="attribute" value="light" />Light <input type="radio" name="attribute" value="water" />Water <input type="radio" name="attribute" value="wind" />Wind</td> And this is the part of the file it's submitting the form to: Line 15 is the line between $type and $attack. The one with $attribute declaration. function invoer_schoonmaken($tekst) { $tekst = strip_tags($tekst); $tekst = htmlspecialchars($tekst); return $tekst; } $naam = invoer_schoonmaken($_POST["naam"]); $type = invoer_schoonmaken($_POST["type"]); $attribute = invoer_schoonmaken($_POST["attribute"]); $attack = invoer_schoonmaken($_POST["attack"]); $defense = invoer_schoonmaken($_POST["defense"]); $stars = invoer_schoonmaken($_POST["stars"]); $description = invoer_schoonmaken($_POST["description"]); $booster = invoer_schoonmaken($_POST["booster"]); The error is gives: So basically, what have I done wrong with the coding here? I'm not skilled in php in any way so I'm just trying to brush it up a bit with some MySQL later, so any constructive help would be greatly appreciated.
×
×
  • 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.