Jump to content

fery0098

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

fery0098's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hi, I'm using MIME to send a html email and i wanted to attach an excel sheet that will be generated from My SQL database to that email. can you help me on how can i generate and attach that excel sheet to emails that my script sends? thank you
  2. hello i use the fallowing code for my login page but it gives me the fallowing error i was wondering what is the problem? (line 179 is the setcookie) by the way it doesn't set the cookie any help would be appreciated error: my code: <? include_once('functions.php'); function cleanQuery($string) { if(get_magic_quotes_gpc()) // prevents duplicate backslashes { $string = stripslashes($string); } $badWords = "(delete)|(update)|(union)|(insert)|(drop)|(http)|(--)"; $string = eregi_replace($badWords, "", $string); if (phpversion() >= '4.3.0') { $string = mysql_real_escape_string($string); } else { $string = mysql_escape_string($string); } return $string; } if (isset($_COOKIE['scmuser'])) { echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=index.php\">"; }else{ if ($_POST['username']) { //did they supply a password and username $username=cleanQuery($_POST['username']); $password=cleanQuery($_POST['password']); if ($password==NULL || $username==NULL) { ?> <p align="center"> <font color="#FF0000">Username or password wasn't supplied!</font><form action="login_acc.php" method="POST"> <table style="border:1px solid #FFFFFF;" width="90%" align="center"> <tr> <td align="center">Username: </td> <td align="center"> <input type="text" size="20" maxlength="25" name="username" /></td> </tr> <tr> <td align="center">Password: </td> <td align="center"> <input type="password" size="20" maxlength="25" name="password" /></td> </tr> <tr> <td align="center" colspan="2"> <input type="submit" value="Login"/> </td> </tr> <tr> <td align="center" colspan="2"> <a href="register.php">Register</a> - <a href="forgetpass.php">Forgot Your Password?</a> </td> </tr> </table> </form> <? }else{ $query = mysql_query("SELECT username,password FROM users WHERE username = '$username'") or die(mysql_error()); $data = mysql_fetch_array($query); if($data['password'] != $password) { ?> <p align="center"> <font color="#FF0000">The supplied login was incorrect</font><form action="login_acc.php" method="POST"> <table style="border:1px solid #FFFFFF;" width="90%" align="center"> <tr> <td align="center">Username: </td> <td align="center"> <input type="text" size="20" maxlength="25" name="username" /></td> </tr> <tr> <td align="center">Password: </td> <td align="center"> <input type="password" size="20" maxlength="25" name="password" /></td> </tr> <tr> <td align="center" colspan="2"> <input type="submit" value="Login"/> </td> </tr> <tr> <td align="center" colspan="2"> <a href="register.php">Register</a> - <a href="forgetpass.php">Forgot Your Password?</a> </td> </tr> </table> </form> <? }else{ $query = mysql_query("SELECT username,password FROM users WHERE username = '$username'") or die(mysql_error()); $row = mysql_fetch_array($query); setcookie("scmuser", "$username", time()+3600); echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=index.php\">"; } } } } ?> thank you
  3. hello, i have made the fallowing code that searches through my mysql database in oder to find something looks like the query that the user is looking for. i was just wondering what should i do in order to make a second page if the results are more than 25. in other words, if there are more than 25 row i want to have a second page and if its more than 50 i want a third page and so on. $searchquery=$_POST['searchquery']; $sql = "SELECT * FROM users WHERE title ILKE '%" . $letter . "%'"; $result = mysql_query($sql); $numrows=mysql_num_rows($result); echo "<p align="center">" .$numrows . " results found for " . $letter . "</p>"; if ($numrows != 0) { ?> <table border="1" style="border-bottom-style:inherit"> <tr> <td bgcolor="#CCCCCC" style="width: 95px"><strong>image</strong></td> <td width="450" bgcolor="#CCCCCC"><strong>Description</strong></td> <td width="100" bgcolor="#CCCCCC"><strong>Book Price</strong></td> <td width="100" bgcolor="#CCCCCC"><strong>Asked Price</strong></td> </tr> <? while($row=mysql_fetch_array($result)){ ?> <tr> <td style="width: 95px"> <img src="CardsPictures/<? echo $row['cardid']; ?>.jpg" width="71" height="96" alt="Front Picture"/></td> <td><a href="http://www.SportsCardMovers.com/show_card.php?cardid=<? echo $row['cardid']; ?>"><? echo $row['title']; ?></a></td> <td><? echo $row['bookprice']?></td> <td><? echo $row['price']?></td> <? } ?> </tr> </table> <? } else echo "Please Use another Query and Search Again"; ?> thank you
×
×
  • 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.