voip03
Members-
Posts
693 -
Joined
-
Last visited
Everything posted by voip03
-
can you post me new code
-
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>'; ?>
-
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
-
Have you connected to your MySQL database ?
-
can you try it
-
How to convert DOB timestamp from MYQL table field to AGE using PHP
voip03 replied to mattyt81's topic in PHP Coding Help
<?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'); ?> -
Why '?' $query = "INSERT INTO articles (pubdate, title, summary, content) VALUES(?, ?, ?, ?)";
-
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 }
-
http://www.tizag.com/ajaxTutorial/
-
you can use sleep() http://php.net/manual/en/function.sleep.php
-
Need ajax
-
this link will help you. http://css-tricks.com/2282-simple-jquery-dropdowns/
-
it call auto suggest just google - Autosuggest tutorials'
-
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.
-
Symbols in my email when sending thr. Contactus ? (Arabic related)
voip03 replied to wadboram's topic in PHP Coding Help
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. -
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";
-
Why are you using the buffer? Speed Up the Website
-
Header location, issue. small piece of code, can anyone take a look
voip03 replied to danjapro's topic in PHP Coding Help
Your code is work fine. Are you starting the code from top and no space? -
PHP Buffer Flushing is it good or bad? thank you all.
-
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>
-
you can not call 2 file in one go you need coma.
-
your code include(db.php login.php) you need to place the code inside the quotation mark.
-
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! ?>
-
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.
-
Header location, issue. small piece of code, can anyone take a look
voip03 replied to danjapro's topic in PHP Coding Help
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(); /*