AyKay47
Members-
Posts
3,281 -
Joined
-
Last visited
-
Days Won
1
Everything posted by AyKay47
-
Just looking for a tutorial for scripting radio buttons.
AyKay47 replied to KDM's topic in Miscellaneous
lol, that is also a viable solution -
Just looking for a tutorial for scripting radio buttons.
AyKay47 replied to KDM's topic in Miscellaneous
<html> <head> <title>My Page</title> </head> <body> <form name="myform" action="path/to/php/file.php" method="POST"> <div align="center"><br> <input type="radio" name="group1" value="Milk"> Milk<br> <input type="radio" name="group1" value="Butter" checked> Butter<br> <input type="radio" name="group1" value="Cheese"> Cheese <hr> <input type="radio" name="group2" value="Water"> Water<br> <input type="radio" name="group2" value="Beer"> Beer<br> <input type="radio" name="group2" value="Wine" checked> Wine<br> <input type="submit" name="submit" value="Submit" /> </div> </form> </body> </html> then you will grab it in file.php if(!empty($_POST['submit'])){ //check if the submit button was clicked $radio_value = $_POST['myForm']; //will be set to chosen value if($radio_value == "Milk"){ //if the user selected millk //act accordingly }elseif($radio_value == "Butter"){//if buter is selected //act accordingly } } etc... -
if those forms are the only ones that you are planning on having on the page, then yes follow example #2
-
if there's no errors and your happy with the result, yes
-
hmm, alright, this is a little tricky, you cant use an explode here because there is no uncommon delimiter... you might be able to use preg_match here to grab each ip address separately...let's try $subject = "56.49.987.5687.564.34.55"; //the haystack $pattern = "~^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$~"; //needle preg_match($pattern, $subject, $matches); foreach($matches as $match){ print "$match <br />"; }
-
will make is much easier if you would post your code please
-
if you use an output buffer you can grab the output of the include file and display it after the setcookie() call, but i normally don't recommend this
-
well the code is too loing and im too lazy to read through all of it...but if $shoutcast_data['hostname'] is a multidimensional array, which it appears to be, you should be able to cycle through each IP like so foreach($shoutcast_data['hostname'] as $value){ print "$value <br />"; } but since i didn't read your code I could be off, perhaps post the code that pertains to this specifically
-
no output can be sent to the browser before calling setcookie(), there is a sticky about it in this section
-
$_SESSION["username"] Doesn't Work On First Attempt
AyKay47 replied to matthewcb's topic in PHP Coding Help
-
top of your php portion...okay so the action is correct.. if you want the errors to be displayed on your webpage instead of having to go to the error.log which you might even know where it is, put this as well on the top of you php code.. ini_set("display_errors","ON");
-
yeah, i don't get how it get's from an option to a url...you never showed us that...So how can you expect us to help with something that is unclear..try a different method
-
this talks about it http://www.codetoad.com/forum/15_24387.asp
-
1. when you click submit...does it keep you on the same page? 2. do you have error_reporting set to E_ALL? If so, what errors do you receive in your error.log? ini_set("error_reporting",E_ALL);
-
I've actually been wondering this myself, I tested what Maq said in miscellaneous and sure enough next to the "new thread" button is a "new poll" button...thanks for that
-
make sure that your form action is sending your data to the right place...also you will want to add in <head> and >body> tags..
-
the index notice refers to $submit = $_POST['submit'] this is only a notice and can really be ignored in this case..basically by setting it to a variable you are initializing the $_POST index without that index having a value since you havn't submitted the form...this will not effect your script whatsoever
-
break just this iteration but continue the loop...
AyKay47 replied to freelance84's topic in PHP Coding Help
no problem, it's similar to the break; statement but continues the loop instead of breaking it completely.. -
break just this iteration but continue the loop...
AyKay47 replied to freelance84's topic in PHP Coding Help
you can use the PHP continue statement -
<?php echo "<h1>Register</h1>"; $submit = $_POST['submit']; if (isset($submit)) { $fullname = $_POST['fullname']; $username = $_POST['username']; $password = $_POST['password']; $repeatpassword = $_POST['repeatpassword']; echo "{$username}/{$password}/{$repeatpassword}/{$fullname}"; } ?> <html> <form action='/1/register.php' method='POST'> <table> <tr> <td> Your full name: </td> <td> <input type='text' name'fullname'> </td> </tr> <tr> <td> Choose a username: </td> <td> <input type='text' name'username'> </td> </tr> <tr> <td> Choose a Password: </td> <td> <input type='password' name'password'> </td> </tr> <tr> <td> Repeat password: </td> <td> <input type='password' name'repeatpassword'> </td> </tr> </table> <p> <input type='submit' name 'submit' value='Register'> </form> </html> this is most likely just a notice, and is triggered because you indices aren't being used until you submit the form...the best thing to do here is to check that the submit button has been set, then set your POST variables like I have don above
-
this code should cycle through your forms and submit each yes
-
if you are using it for a url then replace the "_" with a "&"
-
why wouldn't this method work for you that he provided? echo "<option value='{$var2["DID"]}_{$var2["directory"]}'>{$var2["directory"]}</option>";
-
can you post just the div in question please..Is the div inside of another div?