Jump to content

mmarif4u

Members
  • Posts

    1,244
  • Joined

  • Last visited

About mmarif4u

  • Birthday 08/09/1982

Profile Information

  • Gender
    Male
  • Location
    /dev/swat

mmarif4u's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. I have updated your code, but not tested. Backup your old file 1st. Try to adjust where you need to, also i would suggest to work on the if else statements. <?php session_start(); //Database Information $dbhost = "localhost"; $dbname = "masterdb"; $dbuser = ""; $dbpass = ""; //Connect to database mysql_connect ($dbhost, $dbuser, $dbpass)or die("Error: " .mysql_error()); mysql_select_db($dbname) or die(mysql_error()); $email=mysql_real_escape_string($_POST['email']); if(!$email){ include 'recover.php'; //echo ""; exit(); } $query_email = mysql_query("SELECT email FROM db WHERE email='$email'") or die(mysql_error()); $num_email = mysql_num_rows($query_email); if($num_email != 1){ include 'recover.php'; echo ""; exit(); } else { $sql = mysql_query("SELECT * FROM db WHERE email='$email'") or die(mysql_error()); $result = mysql_query($sql); // if found e-mail address, row must be 1 row // keep value $count = mysql_num_rows($result); if($count==1){ $rows = mysql_fetch_array($result); // keep password $pass = $rows['pass']; $name = $rows['name']; } if($_SESSION['captchaCheck'] != $_POST['providedCaptcha'] && !empty($_SESSION['captchaCheck'])){ // TODO include 'recover.php'; echo ""; unset($_SESSION['captchaCheck']); exit(); } else { include 'blank.php'; echo ""; echo '<META HTTP-EQUIV="Refresh" Content="5; URL=index.php">'; } $yoursite=''; $webmaster='Administrators'; $youremail=''; $subject="&#933;&#960;&#949;&#957;&#952;&#973;&#956;&#953;&#963;&#951; &#922;&#969;&#948;&#953;&#954;&#959;&#973; &#928;&#949;&#955;&#940;&#964;&#951;"; $message="&#913;&#947;&#945;&#960;&#951;&#964;&#942;/&#941; $name, E-Mail: $email &#922;&#969;&#948;&#953;&#954;&#972;&#962; &#928;&#949;&#955;&#940;&#964;&#951;: $pass &#917;&#965;&#967;&#945;&#961;&#953;&#963;&#964;&#974;, $webmaster"; mail($email, $subject, $message, "From: $yoursite<$youremail>\nX-Mailer:PHP/" .phpversion()); } ?>
  2. Try the link fortnox007 posted above, its a rich source of date functions. If still can't figure it out, post the code u tried.
  3. Can you post the whole code at once.
  4. Do you mean, every 1st date of the month? OR please explain more clearly.
  5. Why this: $sql= mysql_query("SELECT pass FROM db WHERE email='$email'"); $result=mysql_query($sql); Why two times mysql_query? why exit() after $pass? Try this //here is my db connection// $result = mysql_query("SELECT email FROM db WHERE email='$email'"); if(!$result){ } else if($email!= mysql_result($result, 0)){ include 'recover.php'; echo "bla bla"; exit(); } $sql= "SELECT pass FROM db WHERE email='$email'"; $result=mysql_query($sql); // if found e-mail address, row must be 1 row // keep value $count=mysql_num_rows($result); if($count==1){ $rows=mysql_fetch_array($result); // keep password $pass=$rows['pass']; } //here I have the Send Email code including: $email $pass Also we don't know how your email code looks like.
  6. Why infinite loop? may be you will look into cronjobs(cron).[if i get you correctly] http://en.wikipedia.org/wiki/Cron
  7. You need to work out your paths in the scripts.
  8. You can do this in query as well in PHP. Many more... In PHP: Assume, datetime format is 2010-12-27 12:23:12. $date = explode(' ', $datetime); echo $date[0];
  9. If i get you correctly. http://php.net/manual/en/function.nl2br.php
  10. <a href='detail.php?id=$id'>$productname</a> And retrieve the data for id on detail.php page. detail.php if($_GET['id'] != '') { $id = $_GET['id']; } $query = "select product,date,name,price from table where id='$id'"; //Do other mysql stuff and show the records This is just an example to get you started.
  11. #2# is random?, like #3#, #4# so on... You can remove it before inserting it to table, but we might need to look into your code for that(if you cant figure it out). Yup, you can remove it later also when retrieving from mysql, but confirm is it random?, or just #2# all the time.
  12. Your code: <?php session_start(); if(!session_is_registered(myusername)){ header("location:index.php"); } else { if(!myusername == 'admin'){ header("location:index.php"); } else { echo "Välkommen ". $_SESSION['user']; } } ?> session_is_registered is deprecated. Now new version for your script: <?php session_start(); if(!$_SESSION['myusername']){ header("location:index.php"); } else { if($_SESSION['myusername'] != 'admin'){ header("location:index.php"); } else { echo "Välkommen ". $_SESSION['myusername']; } } ?>
  13. That mean, the permission are not right for the folder you are trying to write into. Change it to 766, 777. Depends on the situation. http://www.elated.com/articles/understanding-permissions/
×
×
  • 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.