Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by voip03

  1. can you post me new code
  2. Missing <php ?> code in form . <?php $host="localhost"; $username="root"; $password=""; $db_name="dbreg"; $tbl_name="account"; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB");$sql="SELECT * FROM $tbl_name"; $result=mysql_query($sql); echo "<table border=\"5\" width=\"400\" >";echo "<tr><th>List of Student to be approve</th>"; if(mysql_num_rows($result)) { while($row = mysql_fetch_assoc($result)) { echo "<tr><td>"; echo "<input type='checkbox' name='list[]' value='".$row['Username']."'>".$row['famname'].",".$row['gname']. ",".$row['mname']. ".<br/></td>"; echo "</tr></input>"; } } else { echo "<tr><td align=\"center\"> No Student to be Approve / Reject </td></tr>"; } echo'</form>'; ?>
  3. Have you written a code? if not please read this tutorials http://www.satya-weblog.com/2007/05/php-file-upload-and-download-script.html
  4. Have you connected to your MySQL database ?
  5. <?php //calculate years of age (input string: YYYY-MM-DD) function birthday ($birthday){ list($year,$month,$day) = explode("-",$birthday); $year_diff = date("Y") - $year; $month_diff = date("m") - $month; $day_diff = date("d") - $day; if ($day_diff < 0 || $month_diff < 0) $year_diff--; return $year_diff; } echo birthday('1960-06-14'); ?>
  6. Why '?' $query = "INSERT INTO articles (pubdate, title, summary, content) VALUES(?, ?, ?, ?)";
  7. This is only example $sql = "SELECT usename FROM USER WHERE username ='". $_POST['username']."'"; $res = mysql_query($sql); if(!res){ die(" Could not query the database : <br/>". mysql_error() ); } $numRows = mysql_num_rows($res); if( $numRows != 0 ) { // ? check the passowrd } else { // ! username error }
  8. you can use sleep() http://php.net/manual/en/function.sleep.php
  9. this link will help you. http://css-tricks.com/2282-simple-jquery-dropdowns/
  10. it call auto suggest just google - Autosuggest tutorials'
  11. 1. read this topic http://www.phpfreaks.com/forums/index.php?topic=37442.0 2. place this code top of the code /* "Warning: Cannot modify header information - headers already sent by " To avoid the header error , give value zero to $mosConfig_locale_debug = 0; $mosConfig_locale_use_gettext = 0; */ $mosConfig_locale_debug = 0; $mosConfig_locale_use_gettext = 0; ob_start(); 3.Open the windows and shout ' header sucks! ' AND start Re arranging the logics and code.
  12. The way to get non-ASCII characters into a mail body is to set Content-Transfer-Encoding to either base64 or quoted-printable, and the encode the body with base64_encode or quoted_printable_encode, respectively.
  13. your code $headers = 'From: noreply@abc.com' . "\r\n" . 'Reply-To: noreply@abc.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); Replace this code $headers = "MIME-Version: 1.0\r\n"; $headers.= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers.= "From: $from\r\n";
  14. Why are you using the buffer? Speed Up the Website
  15. Your code is work fine. Are you starting the code from top and no space?
  16. PHP Buffer Flushing is it good or bad? thank you all.
  17. 1st try this code. once you happy with it then start your one. <?php if (isset($_POST['submitted']) && !empty($_POST['myusername']) && !empty($_POST['mypassword'])) { //check for submit button click $username = $_POST['myusername']; $password = $_POST['mypassword']; // NOTE - quick check $_SESSION['username'] = $username; echo "Hello ".$_SESSION['username']; // remove '/* */ ' when the st test result is OK. /* // proceed with rest of code $self = $_SERVER['PHP_SELF']; $referer = $_SERVER['HTTP_REFERER']; #if either form field is empty return to the log-in page if( (!$username ) or (!$password ) ){ header( "Location:$referer" ); exit(); } #connect to mysql $conn = @mysql_connect( "server", "username", "password" ) or die( "Could not connect" ); #select database $rs = @mysql_select_db( "removalspacelogin", $conn ) or die ( "Could not select db" ); #create query $sql="select * from users where username = '". $username."' and upassword = '".$password."'"; #execute query $rs = mysql_query( $sql, $conn ) or die( mysql_error() ); if($rs){ $_SESSION['username'] = $username;} #get number of rows that match username and password $num = mysql_numrows( $rs ); #if there is a match the log-in is done if( $num != 0 ){ header( "Location:login_success.php" ); } else { header( "Location:$referer" ); exit(); }} */ } else { ?> <?php ini_set("display_errors","ON"); ?> <html><head><title>Check-login</title></head> <body> <?php echo( $msg ); ?> <form action="#" method="post"> <fieldset> <legend>Login</legend> <p>Username: <input name="myusername" type="text" size="60" maxlength="100" /></p> <p>Password: <input name="mypassword" type="password" size="60"/></p> <!-- The hidden input here is a trick I use to check for a form’s submission. Doing this is sometimes necessary as just pressing Enter within Internet Explorer for Windows will submit a form withoutever setting the $_POST['submit']variable. --> <input name="submitted" type="hidden" value="true" /> <input name="submit" type="submit" value="Login" /> </form> </body> <? } ?> </html>
  18. you can not call 2 file in one go you need coma.
  19. your code include(db.php login.php) you need to place the code inside the quotation mark.
  20. Before you start using PHP session, you must first start the session. When you start a session, it must be at the very beginning of your code, before any HTML or text is sent. <?php session_start(); // start up your PHP session! ?>
  21. But sometimes their examples are simple and easy to understand And sometimes those very same examples are wrong. Sure, one in a handful is good, but people new to the content won't be able to tell what is and what isn't. Yes, you are correct. I will stop referring.
  22. If you like try this code (place it top of your code), let me know the result. /* "Warning: Cannot modify header information - headers already sent by " To avoid the header error , give value zero to $mosConfig_locale_debug = 0; $mosConfig_locale_use_gettext = 0; */ $mosConfig_locale_debug = 0; $mosConfig_locale_use_gettext = 0; ob_start(); /*
  • 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.