Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.
All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!
<form action="In.php" method="post">
<table>
<tr>
<td>Record:</td><td> <input type="text" name="record" />
</td>
<tr>
<td>Time:</td><td> <input type="text" name="time" />
</td>
<tr></tr>
<td>Subject:</td><td><input type="text" name="subject"/>
</td>
<tr></tr>
<td>Course:</td><td> <input type="text" name="course" />
</td>
<tr></tr>
<td>Section:</td><td> <input type="text" name="section"/>
</td>
<tr></tr>
<td>Day:</td><td> <input type="text" name="day"/>
</td>
<tr></tr>
<td>Room:</td><td><input type="text" name="room" />
</td>
<tr></tr>
<td><input type="submit" value = "SUBMIT" name="submit"/></td><td><a href="index.php" style="text-decoration:none;"><input type="button" value="CANCEL" /></a></td>
</table>
</form>
<?php
if(isset($GET['success'] === TRUE)){
if($GET['success'] == 'completed'){
echo "<center>1 record added!</center>";
}elseif($GET['success'] == 'failed'){
echo "<center>No records were added</center>";
}
}
?>
<?php
if(isset($GET['success'] === TRUE)){
if($GET['success'] == 'completed'){
echo "<center>1 record added!</center>";
}elseif($GET['success'] == 'failed'){
echo "<center>No records were added</center>";
}
}
<?php
$con = mysql_connect("localhost","pma");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("class_schedule", $con);
$sql="SELECT * FROM schedule WHERE record = '$record' AND time = '$time' AND subject = '$subject' AND course='$course' AND section = '$section' AND day = '$day' AND room = '$room'";
$result = mysql_query($sql, $con);
if($result){
$num_rows = mysql_num_rows($result);
if($num_rows == 0)
{
$sql="INSERT INTO schedule (record, time, subject, course, section, day, room)
VALUES
('$_POST[record]','$_POST[time]','$_POST[subject]','$_POST[course]','$_POST[section]','$_POST[day]', '$_POST[room]')";
$success="completed";
}
elseif($num_rows == 1){
echo"Error";
$success="failed";
}
}
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
mysql_close($con)
?>
sir ask ko lang po kung wat specific code po for message box sa php na may yes at cancel button advance tnx!
Kuya, nabago ko na po lahat pacheck po, nagaadd pa din po kahit nageexist na yung record.
Add.php
Code:<form action="In.php" method="post"> <table> <tr> <td>Record:</td><td> <input type="text" name="record" /> </td> <tr> <td>Time:</td><td> <input type="text" name="time" /> </td> <tr></tr> <td>Subject:</td><td><input type="text" name="subject"/> </td> <tr></tr> <td>Course:</td><td> <input type="text" name="course" /> </td> <tr></tr> <td>Section:</td><td> <input type="text" name="section"/> </td> <tr></tr> <td>Day:</td><td> <input type="text" name="day"/> </td> <tr></tr> <td>Room:</td><td><input type="text" name="room" /> </td> <tr></tr> <td><input type="submit" value = "SUBMIT" name="submit"/></td><td><a href="index.php" style="text-decoration:none;"><input type="button" value="CANCEL" /></a></td> </table> </form> <?php if(isset($GET['success'] === TRUE)){ if($GET['success'] == 'completed'){ echo "<center>1 record added!</center>"; }elseif($GET['success'] == 'failed'){ echo "<center>No records were added</center>"; } } ?>
Sa add.php may error po sa part na 'to:
Code:<?php if(isset($GET['success'] === TRUE)){ if($GET['success'] == 'completed'){ echo "<center>1 record added!</center>"; }elseif($GET['success'] == 'failed'){ echo "<center>No records were added</center>"; } }
Ito naman po yung sa In.php
Code:<?php $con = mysql_connect("localhost","pma"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("class_schedule", $con); $sql="SELECT * FROM schedule WHERE record = '$record' AND time = '$time' AND subject = '$subject' AND course='$course' AND section = '$section' AND day = '$day' AND room = '$room'"; $result = mysql_query($sql, $con); if($result){ $num_rows = mysql_num_rows($result); if($num_rows == 0) { $sql="INSERT INTO schedule (record, time, subject, course, section, day, room) VALUES ('$_POST[record]','$_POST[time]','$_POST[subject]','$_POST[course]','$_POST[section]','$_POST[day]', '$_POST[room]')"; $success="completed"; } elseif($num_rows == 1){ echo"Error"; $success="failed"; } } if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } mysql_close($con) ?>
Pasensya na po :'( Sana po ay tulungan niyo pa din ako
TS, patanong naman... meron ka pong jquery script na gumagawa nang pop-up under window sa blogspot?
sir , pano na po icoconect ung database mo pag pinag upload mo na sya sa freewebhosting ? 3owl.com po gamit kung webhosting . salamat po
upload nyo din po dun sa site nyo sa 3owl.com ung dump file nung database nyo (*.sql)
tapos ts , ano ang ilalagay ko dyan sa may mga "?" .
<?php
mysql_connect("?", "?", "?") or die ("Could not connect to Database");
mysql_select_db("login") or die("No Database selected");
?>
mysql_connect("db_host", "db_username", "db_password") or die ("Could not connect to Database");