Jump to content

omerta

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

omerta's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Suppose you have this variable from a form.. $friend_email [code] // Sending an html mail // Your recipient $to = ($_GET['friend_email']); // subject $subject = 'Tell A Friend'; // message $message = 'HTML CODE'; // Insert your html code here // To send HTML mail, the Content-type header must be set $headers  = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'From: Your Site Name <admin@yoursite.com>' . "\r\n"; // Mail it mail($to, $subject, $message, $headers);[/code]
  2. You cannot CHMOD on Windows because it's a command for unix system, although Windows has equivalent function for changing modes (CHMOD). Try this. 1. In your windows explorer, go to the path of folder that you want to make writable C:\\Documents and Settings\\Lyricsride\\Mes documents\\Mes images\\. 2. Right click on the folder and select sharing and security, check SHARE THIS FOLDER ON THE NETWORK and ALLOW NETWORK USERS TO CHANGE MY FILE, thereafter name the folder you want to share. 3. Go to WEB SHARING and choose SHARE THIS FOLDER, and thereafter, set the type of permission that you want to use. If in case you want to deploy your application on a live webserver in the future, by using an ftp client, simply right click on the remote folder that you want to make writable and select CHMOD (particularly on Smart ftp client and cute ftp) and set to 777, provided it is a unix hosting service.
  3. Thanks for replying so soon. Actually, it doesn't happen in every IE browser because it worked on my pc. I sort of figure out maybe some of the voters didn't have their IE browsers set to accept cookies or they did not use the default settings for the browser, therefore, causing the loop and redirection to index page. Our report says, complaints were coming from those who voted using a rented pc (internet cafes). Most I-netCafe turned off this feature to their browsers. Here it is... now.php [code]<?php require_once ('verify2.php'); ?> <?php ob_start(); //Start output buffering // Set the page title $page_title = 'Voters Information Log'; if (isset($_POST['submit'])) { // Handle the form. // check for db connection require_once ('dbcon.php'); $message = NULL; // Create an empty new variable. if (eregi("^[_0-9]{4,6}$", $card_no)) { $cn = FALSE; $message .= '<p><font color="red" size="+1"> INVALID card number!</font></p>'; } else { $cn .= $_POST['card_no']; } if (eregi ("^[[:alnum:]]{8,10}$", stripslashes(trim($_POST['serial_no'])))) { $sn = escape_data($_POST['serial_no']); } else { $sn = FALSE; $message .= '<p><font color="red" size="+1"> INVALID serial number!</font></p>'; } } // End of validation if ($cn && $sn) { // If everythings ok. // Check if the serial code is still valid for use $query = "SELECT id, name FROM voters_log WHERE card_no='$cn' AND serial_no='$sn'"; $result = @mysql_query ($query); $row = mysql_fetch_array ($result, MYSQL_NUM); if ($row) { //If none returned, serial code is still valid for use setcookie ('name', $row[1]); setcookie ('id', $row[0]); ob_end_clean(); //delete the buffer header ("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/vote_app.php"); //start voting application exit(); } else { $message = '<p>The card and serial numbers you entered did not match with our registry.</p><p>' . mysql_error() . '</p>'; } mysql_close(); } // End of the main submit conditional //Set the page title and include header. $page_title = 'Mr. and Ms. Photogenic - Image Model Search 2006'; include ('header_v.inc'); // Print the message if there is one. if (isset($message)) { echo '<span class="error">' , $message, '</span>'; } ?> <table width="100%" border="0" cellpadding="0" cellspacing="0">             <!--DWLayoutTable-->             <tr>               <td height="27" colspan="2" valign="top"><p class="style1">Please re-enter card                 and serial numbers               for verification:</p></td>             </tr>             <tr>               <td width="252" height="239" valign="top" class="ins"><!--DWLayoutEmptyCell-->&nbsp;</td> <td width="715" valign="top"><form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">                     <p>                       <span class="style1">                      </span><span class="style1">                       Card No. <br />                       <input name="card_no" type="text" class="style1" value="<?php if (isset($_POST['card_no'])) echo $_POST['card_no']; ?>" />                       </span><span class="style4">*</span><span class="style1"> <br />                       Serial No. <br />                                      <input name="serial_no" type="text" class="style1" value="<?php if (isset($_POST['serial_no'])) echo $_POST['serial_no']; ?>"/>                 <span class="style4">* </span></span></p>                     <p>                       <span class="style1">                       <input type="submit" name="submit" value="Sign In" />                       </span> </p>               </form>                <p>&nbsp;</p></td>         </tr>           </table> <?php include ('footer_v.inc'); ob_end_flush(); //delete the buffer ?>[/code] verify2.php [code]<?php ob_start(); //Start output buffering //if no cookie is present, redirect the user. if (!isset($_COOKIE['serial_no'])) { ob_end_clean(); //delete the buffer header ("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/index.php"); exit(); //quit script } ?>[/code] index.php [code]<?php $URL="http://sampleurl.com/login/get_log.php"; header ("Location: $URL"); ?> [/code]
  4. Hello! Form had been processed but it did not redirect the page; Happens only in IE browser but runs ok in Mozilla Firefox and Opera. The script is shown below. This is a card number and serial code validation script for our online voting of Mr. and Ms. Photogenic Search. The system requires every voter to purchase an online voting card with the number and serial code combination as pass key for voting. The pass key combination should only be used once, which means the next time you login with the same card and serial nos., it will return a card expiry message. My problem lies on redirecting the page to "/now.php" after it had processed the form. Our voters had complained that after they register with their name, email, card no. and serial no. and submit the form, they are stuck within the same page (form submit page). When they tried to login again with the same card, they get the card expiry message. Can anyone help me figure out where my problem lies? Any help would be greatly appreciated. Thanks. The script: [code]<?php ob_start(); //Start output buffering // Set the page title $page_title = 'Voters Information Log'; if (isset($_POST['submit'])) { // Handle the form. setcookie('serial_no', $_POST['serial_no']); // check for db connection require_once ('dbcon.php'); $message = NULL; // Create an empty new variable. // Check for voter information if (empty($_POST['name'])) { $nm = FALSE; $message .= "<p>Please enter your name!</p>"; } else { $nm = $_POST['name']; } if (empty($_POST['email'])) { $em = FALSE; $message .= "<p>Please enter your email!</p>"; } else { $em = $_POST['email']; } if (eregi("^[_0-9]{4,6}$", $card_no)) { $cn = FALSE; $message .= '<p><font color="red" size="+1"> INVALID card number!</font></p>'; } else { $cn .= $_POST['card_no']; } if (eregi("^[[:alnum:]]{8,10}$", stripslashes(trim($_POST['serial_no'])))) { $sn = escape_data($_POST['serial_no']); } else { $sn = FALSE; $message .= '<p><font color="red" size="+1"> Bad card and serial number combination!</font></p>'; } } // End of validation if ($nm && $em && $cn && $sn) { // If everythings ok. //Check if the card and serial no. is genuine $query = "SELECT id FROM users WHERE password='$sn'"; $result = @mysql_query ($query); $row = mysql_fetch_array ($result, MYSQL_NUM); if ($row) {//serial code is genuine // Check if the serial code is still valid for use $query = "SELECT id FROM voters_log WHERE serial_no='$sn'"; $result = @mysql_query ($query); if (mysql_num_rows($result) == 0) { //If none returned, serial code is still valid for use // Permit the user with his card and serial nos. $query = "INSERT INTO voters_log(name, email, card_no, serial_no, date_voted) VALUES ('$nm', '$em', '$cn', '$sn', NOW())"; $result = @mysql_query ($query); //run the query if ($result) { //if successful ob_end_clean(); //delete the buffer // redirect to verification header ("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/now.php"); exit(); } else { $message = '<p>Your request is temporarily blocked due to a system error. We apologize for any inconvenience.</p><p>' . mysql_error() . '</p>'; } } else { // If the card and serial nos. had been used already $message = '<p><font color="red" size="+1">Sorry! Your ONLINE VOTING CARD had expired.</font></p>'; } } else { // If the card and serial nos. combination is not genuine $message = '<p><font color="red" size="+1">The card and serial numbers do not match those on our file.</font></p>'; } mysql_close(); } // End of the main submit conditional //Set the page title and include header. $page_title = 'Mr. and Ms. Photogenic - Image Model Search 2006'; include ('header_v.inc'); // Print the message if there is one. if (isset($message)) { echo '<span class="error">' , $message, '</span>'; } ?> <table width="100%" border="0" cellpadding="0" cellspacing="0">             <!--DWLayoutTable-->             <tr>               <td width="219" height="42" valign="top"><p class="style1Copy">Please enter information:</p></td>               <td width="392" rowspan="2" valign="top"><form action="<? echo $_SERVER['PHP_SELF']; ?>" method="POST">                     <p>                       <span class="style1">                       Your Name<br />                       <input name="name" type="text" class="style1" value="<?php if (isset($_POST['name'])) echo $_POST['name']; ?>"/>                       <span class="style4">                      *                      </span></span><span class="style4">Required for card ownership validation.</span><span class="style1"><br />                       Your Email <br />                       <input name="email" type="text" class="style1" value="<?php if (isset($_POST['email'])) echo $_POST['email']; ?>" />                       </span>                      <span class="style4"> * Required for contact purposes.</span><span class="style1"><br />                       Card No. <br />                       <input name="card_no" type="text" class="style1" value="<?php if (isset($_POST['card_no'])) echo $_POST['card_no']; ?>" />                       </span><span class="style4">*</span><span class="style1"> <br />                       Serial No. <br />                                      <input name="serial_no" type="text" class="style1" value="<?php if (isset($_POST['serial_no'])) echo $_POST['serial_no']; ?>"/>                     <span class="style4">* </span></span></p>                     <p>                       <span class="style1">                       <input type="submit" name="submit" value="Sign In" />                       </span> </p>               </form>                <p>&nbsp;</p></td>         </tr>             <tr>               <td height="209" valign="top" class="ins">Please read                 <a href="../how_to_vote.php" class="ins"><br>                 VOTING INSTRUCTIONS</a> <br />                 carefully                 before attempting <br />                 to               login.</td>             </tr>           </table> <? include ('footer_v.inc'); ob_end_flush(); //delete the buffer ?> [/code]
×
×
  • 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.