Adam77
-
Posts
15 -
Joined
-
Last visited
Posts posted by Adam77
-
-
hey guys, i hope this is the right place to my question .
i have an html page wich contain a section with a form for the user to fill out. now, after the user fill the form he should move to the next form in the same section of the page . the question is, how do i earse the form that already been filled out and replace it with the next form .
i hope it was clear enough .
thanks
Adam
-
does anyone can tell me why the navigation bar doesn't collapsing and why the button is not triggering him ?
-
thanks brother
-
hey man, im kind a begginer as you probably understand . im using my local host right now with xampp control panel, can you tell me more specific what should i config ? as i said the html file runs fine through the local host but without the php that in it .
appreciate it man
-
hey everyone,
my html code has php code in it, but the php does not run at all . the php code run fine separatly from the html . any suggestion ?
i add my html plus a short php code(an echo cmd) in it just for you to understand and tell me what am i doing wrong ..
-
THANKS BRAVE MAN
-
according to the fetch row, if the fetch do set the switch excute, otherwise it dont .
-
im trying not to take you personally, but can you offer me some substitute solution because somehow the code is working so why is it a problem ?
-
hey guys,
i managed to do i needed thank you all !! now i need to put the form i created in my html page and i have a problem with that ..
i want to put the form in a div section .
i added the php code ( test)
<?php // include("connect.php"); $db_host = "localhost"; $db_username = "root"; $db_pass = "test123"; $db_name = "test_database"; $table="placeinline"; $dbcon = mysqli_connect("$db_host","$db_username","$db_pass", "$db_name" ) or die("could not connect to mysql"); @mysql_select_db("$db_name") or die ("no database"); //echo "successful Connection"; for($k=1; $k<=12;$k++){ $query= "SELECT * FROM placeinline WHERE choice = $k "; $result= mysql_query($query); if(mysql_fetch_array($result)){ switch($k) { case 1: $disab1= "disabled"; break; case 2: $disab2= "disabled"; break; case 3: $disab3= "disabled"; break; case 4: $disab4= "disabled"; break; case 5: $disab5= "disabled"; break; case 6: $disab= "disabled"; break; case 7: $disab7= "disabled"; break; case 8: $disab8= "disabled"; break; case 9: $disab9= "disabled"; break; case 10: $disab10= "disabled"; break; case 11: $disab11= "disabled"; break; case 12: $disab12= "disabled"; break; } } } echo '<form action="test.php" method="POST">'; echo '<input type="date" id= "linedate"><br/>'; echo "<li> <input type='radio' name='placeInLine' id='choice1' $disab1 value= '1' /> 10:00-10:15 </li>"; echo "<li> <input type='radio' name='placeInLine' id='choice2' $disab2 value= '2' /> 10:15-10:30 </li>"; echo "<li> <input type='radio' name='placeInLine' id='choice3' $disab3 value= '3' /> 10:30-10:45 </li>"; echo "<li> <input type='radio' name='placeInLine' id='choice4' $disab4 value= '4' /> 10:45-11:00 </li>"; echo "<li> <input type='radio' name='placeInLine' id='choice5' $disab5 value= '5' /> 11:00-11:15 </li>"; echo "<li> <input type='radio' name='placeInLine' id='choice6' $disab6 value= '6' /> 11:15-11:30 </li>"; echo "<li> <input type='radio' name='placeInLine' id='choice7' $disab7 value= '7' /> 11:30-11:45 </li>"; echo "<li> <input type='radio' name='placeInLine' id='choice8' $disab8 value= '8' /> 11:45-12:00 </li>"; echo "<li> <input type='radio' name='placeInLine' id='choice9' $disab9 value= '9' /> 12:00-12:15 </li>"; echo "<li> <input type='radio' name='placeInLine' id='choice10' $disab10 value= '10'/> 12:15-12:30 </li>"; echo "<li> <input type='radio' name='placeInLine' id='choice11' $disab11 value= '11'/> 12:30-12:45 </li>"; echo "<li> <input type='radio' name='placeInLine' id='choice12' $disab12 value= '12'/> 12:45-13:00 </li>"; echo '<input type="submit" value="Submit">'; echo "</form>"; $choice = $_POST['placeInLine']; echo $choice; $sqlinsert = "INSERT INTO placeinline (choice) VALUES ('$choice') "; if(!mysqli_query($dbcon,$sqlinsert)){ die('error insertin'); } $newrecord = " 1 choice added to the line"; echo $newrecord; ?>
-
got you .. ill study more of php
-
hey man, i was trying to make it a bit more simple but i have a syntax problem i cant solve , do you mind take a look ?
<title>hairdresser</title><?phpinclude("connect.php");ini_set('display_errors', 'Off');if(isset($_POST['submitted'])){$choice = $_POST['placeInLine'];$query = "SELECT `choice` FROM `placeinline`";$result = mysql_query($query );if($query_run = mysql_query($query) ){echo 'good';}else{echo mysql_error();}$disab = '' ;$row = mysql_fetch_row($result);if($choice==$row){$disab = 'disabled';}<form id= "line" name="line " action="test1.php" method="post">echo "<li> <input type='radio' name='placeInLine' id='choice1' $disab value='1' /> 10:00-10:15 </li>";echo "<li> <input type='radio' name='placeInLine' id='choice2' $disab value='2' /> 10:15-10:30 </li>";echo "<li> <input type='radio' name='placeInLine' id='choice3' $disab value='3' /> 10:30-10:45 </li>";echo "<li> <input type='radio' name='placeInLine' id='choice4' $disab value='4' /> 10:45-11:00 </li>";echo "<li> <input type='radio' name='placeInLine' id='choice5' $disab value='5' /> 11:00-11:15 </li>";echo "<li> <input type='radio' name='placeInLine' id='choice6' $disab value='6' /> 11:15-11:30 </li>";</form>mysql_query("INSERT INTO $table(choice) VALUES ($choice)") or die(mysql_error());$sqlinsert = "INSERT INTO placeinline (choice) VALUES ($choice)";$newrecord = "1 choice added to the line";echo $newrecord;}?> -
i read quickstart edition, i guess its not enogh but if you could still explain me the way i do that.. the array should look like that, but how do i add it to the specific
button ,?
$ch[1] = 'disabled';$ch[2] = '';$ch[3] = '';$ch[4] = ' -
hey man,
look i have a list of radio buttons as you said, im kind of new to this, what do you mean by session array ? if you can show me a little example ..
this is my html form
<form id= "line" name="line " action="index.php" method="post"><input type="hidden" name="submitted" value="true"/><ul><li><input type="radio" name="placeInLine" id="choice3" value="3" onclick="toggle('show')"/>10:30-10:45</li><li><input type="radio" name="placeInLine" id="choice4" value="4" onclick="toggle('show')"/>10:45-11:00</li><li><input type="radio" name="placeInLine" id="choice5" value="5" onclick="toggle('show')"/>11:00-11:15</li><li><input type="radio" name="placeInLine" id="choice6" value="6" onclick="toggle('show')"/>11:15-11:30</li><li><input type="radio" name="placeInLine" id="choice7" value="7" onclick="toggle('show')"/>11:30-11:45</li><li><input type="radio" name="placeInLine" id="choice8" value="8" onclick="toggle('show')"/>11:45-12:00</li><br /><input type="submit" value="Save my choice" class="button" /></ul></form> -
hey guys please help me out here !
i did a time line which people fill their place in line with radio button ., now i want to make the radio button that
already been picked to be disable for everyone else so it cant be picked twice . i have an sql database where i put(by php) the submitted picking.
will appreciate any help !!!
Adam
how to start a new page
in PHP Coding Help
Posted
thanks guy, appreciate it !