PHP - Moved: Check/uncheck Checkboxhelp
This topic has been moved to JavaScript Help.
http://www.phpfreaks.com/forums/index.php?topic=320394.0 Similar TutorialsThis topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=318750.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=317810.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=306339.0 This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=347295.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=313543.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=313299.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=311729.0 This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=306254.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=327134.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=331164.0 This topic has been moved to PHP Installation & Configuration. http://www.phpfreaks.com/forums/index.php?topic=326567.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=347719.0 I am unable to execute mysql_num_rows properly in this program. Code: [Select] <?php $link=mysql_connect("localhost","root",""); $db = mysql_select_db("myDB",$link); $result = mysql_query("SELECT * FROM jobs WHERE jobType=abc"); $num = mysql_num_rows($result); echo "Found $num records"; ?> error is mysql_num_rows() expects parameter 1 to be resource Suppose i have a table with around 10 entries in which one column contains the id and the second column contains a checkbox... If a checkbox a selected and the button (below the table) is pressed then i want to delete the columns corresponding the checked checkboxes.... I am not getting how sgould i pass the get variable on the link of the button??? -Pranshu Agrawal pranshu.a.11@gmail.com Hello, I have created a little voting script for my site. The insertion code into the MySQL databse when they vote is very simple: $ipaddress = addslashes($_POST['ipaddress']); $theid = addslashes($_POST['theid']); $gamert = addslashes($_POST['gamert']); $serveron = addslashes($_POST['serveron']); $db = mysql_connect("localhost", "username", "password"); mysql_select_db("thedb",$db); mysql_query ("INSERT INTO voting (theid,ipaddress,gamert,serveron2) VALUES ('$theid','$ipaddress','$gamert','$serveron') "); Obviously I only want them to be able to vote once. What is the best way to do a check of the IPs already in the database and check against theirs before submitting? Thanks. ok so i can get this to work so i want to check if there is a video on inside my db if there is no video and nothing happens but if there is i want it to echo video Code: [Select] <?php if($video == ""){ }else{ echo "VIDEO"; } ?> Hello their, I'm wanting to use PHP to check to see if a username and password match a remote RDP server. The reason I ask is because I want to verify that the information the user is giving is correct. I'm looking though LDAP but I have no idea what I'm looking for. To recap, I would like to login to a RDP server and return a result based on if it completed. Thank-you for reading Paul P.S Sorry for the bad English, I seemed to forgot how to spell some words and have had to replace them with longer sentences I want an if statement that not only checks for the existence of a variable, but which also checks all the variables already created for one with a specific value. For example, I have a loop which creates variables, but I don't want it to make two variables with the same value. The problem is, using
if(isset(${'h'.$x}==false) && ${'h'.$x} != 3{ }won't work since the variable equal to 3 could be named h4, whereas this one will be named h5. I hoped I explained this efficiently enough, sorry about any confusion. could anyone please help me with the code which is i have already displayed data from two table as a drop-down list and a multi select list but now i need to select one from drop-down list and one or more from multi select list the insert into another database table. here is the coding. it shows no error message( blank page after submit) and nothing inserted on the take able <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } error_reporting(E_ALL); ini_set('display_errors', 1); mysql_select_db("uni", $con)or trigger_error('MySQL error: ' . mysql_error()); $result = mysql_query("SELECT * FROM course") or trigger_error('MySQL error: ' . mysql_error()); echo '<select name ="cid[]" multiple="multiple" size="10">'; while($row = mysql_fetch_array($result)) { echo '<option value="' . $row['CourseID'] . '">' . $row['CourseName'] . '</option>'; } echo '</select>'; // ---------------- $result = mysql_query("SELECT * FROM student") or trigger_error('MySQL error: ' . mysql_error()); echo '<select name="sid">'; while($row = mysql_fetch_array($result)) { echo '<option value="' . $row['StudentID'] . '">' . $row['StudentName'] . '</option>'; } echo '</select>'; mysql_close($con); ?> <form id="form1" name="form1" method="post" action="update_result.php"> <label> <input type="submit" name="Submit" value="Submit" /> </label> </form> </body> </html> update_result.php <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("uni", $con)or trigger_error('MySQL error: ' . mysql_error()); if (!empty($_POST['sid']) && !empty($_POST['cid'])) { foreach ($_POST['cid'] as $key => $course) { $courses .= $course."-"; } $courses = rtrim($courses,"-"); $student = $_POST['sid']; $sql = "INSERT INTO test (StudentID, CourseID) VALUES('".mysql_real_escape_string($student)."','".mysql_real_escape_string($courses)."')"; $query = mysql_query($sql) or trigger_error('MySQL error: ' . mysql_error()); if (mysql_affected_rows() > 0) { echo mysql_affected_rows() . ' rows added.'; } } mysql_close($con); ?> </body> </html> I am writing a script, but keep getting a 500 error page. I've tried various tricks to isolate the problem to no avail. My old system would always send me an email to report the error, but since my new box, it isn't working The major change from my old setup is that I am now using fast CGI I rememeber that there is a log that records errors but I havn't been able to find it if there is one... Or I am looking in the wrong places. Can anyone nudge me in the right direction on this? Thanks, David |