Jump to content

waterwn1097

Members
  • Posts

    10
  • Joined

  • Last visited

waterwn1097's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thanks for the reply I placed the double quote after the email ending and still no result thanks
  2. alright so another post- might be a dumb issue on my part. I want this email to be sent to my customer when the form is submitted. <?php include_once("scripts/connect.php"); $message = ''; if(isset($_POST['Submit'])) { $id = $_POST['id']; $contractlink = $_POST['contractlink']; $foliolink = $_POST['foliolink']; $status = $_POST['status']; $quote = $_POST['quote']; $deposit = $_POST['deposit']; $vaddress = $_POST['vaddress']; $vcity = $_POST['vcity']; $vstate = $_POST['vstate']; $sql = mysql_query("UPDATE clients SET contractlink='$contractlink', foliolink='$foliolink', status='$status', quote='$quote', deposit='$deposit', vaddress='$vaddress', vcity='$vcity', vstate='$vstate' WHERE id='$id'"); $message = "The Customers Information has been updated."; $lastname = $row['lastName']; $autoreply = "Hi $firstname, We have uploaded your quote for your event! Log in back into your account and view our quote offers. If you would like to hire us based on this quote please respond to this email and view the paperwork on your account page. Thanks! Wesley $replyemail = "From: wesley@email.com"; mail ("$email", "Alpha Dog Entertainment Quote Now Loaded", $autoreply, $replyemail); } ?> however the email is not sending. Please help!!
  3. so i am trying to use a form to upload pdf documents to my server remotely. The php code is in its own file called "upload.php". The error I am getting is the die error "The file you attempted to upload is not allowed" therefore something is wrong because I have permissions set for PDF documents which is what I am trying to upload. <?php // Configuration - Your Options $allowed_filetypes = array('.pdf'); // These will be the types of file that will pass the validation. $max_filesize = 524288; // Maximum filesize in BYTES (currently 0.5MB). $upload_path = './users/'; // The place the files will be uploaded to (currently a 'files' directory). $filename = $_FILES['userfile']['name']; // Get the name of the file (including file extension). $ext = substr($filename, strpos($filename,'.'), strlen($filename)-1); // Get the extension from the filename. // Check if the filetype is allowed, if not DIE and inform the user. if(!in_array($ext,$allowed_filetypes)) die('The file you attempted to upload is not allowed.'); // Now check the filesize, if it is too large then DIE and inform the user. if(filesize($_FILES['userfile']['tmp_name']) > $max_filesize) die('The file you attempted to upload is too large.'); // Check if we can upload to the specified path, if not DIE and inform the user. if(!is_writable($upload_path)) die('You cannot upload to the specified directory, please CHMOD it to 777.'); // Upload the file to your specified path. if(move_uploaded_file($_FILES['userfile']['tmp_name'],$upload_path . $filename)) echo 'Your file upload was successful, view the file <a href="' . $upload_path . $filename . '" title="Your File">here</a>'; // It worked. else echo 'There was an error during the file upload. Please try again.'; // It failed . ?> here is the HTML form code <center><table width="600" align="center" cellpadding="5"> <form action="upload.php" method="post"> <p><font color="red"><?php print("$message");?></font></p> <tr> <td width="163"><div align="right">File:</div></td> <td width="409"><input type="file" name="userfile" id="file"/></td> </tr> <tr> <td><div align="right"></div></td> <td><input type="submit" name="Submit" value="submit" /></td> </tr> </form> </table> </center> thanks
  4. okay so here is the deal, I have an entire website completely set up with a registration page and the whole nine. Once a client has been registered i would like to be able to login to my admin page on my website and update some of the values contained in that clients row so then they have their own page that has been uniquely updated. <?php include_once("scripts/connect.php"); $message = ''; if ($_POST['state']) { $id = $_POST['id']; $contractlink = $_POST['contractlink']; $foliolink = $_POST['foliolink']; $status = $_POST['status']; $quote = $_POST['quote']; $deposit = $_POST['deposit']; $sql = mysql_query("UPDATE clients SET contractlink='$contractlink', foliolink='$foliolink', status='$status', quote='$quote', deposit='$deposit' WHERE id='$id'"); $message = "The Customers Information has been updated."; } ?> and here is the form code <table width="600" align="center" cellpadding="5"> <form action="adminin.php" method="post"> <p><font color="red"><?php print("$message");?></font></p> <tr> <td width="163"><div align="right">ID:</div></td> <td width="409"><input type="text" name="id" placeholder="ID" /></td> </tr> <tr> <td><div align="right">Contract Link:</div></td> <td><input type="text" name="contractlink" placeholder="Contract Link" /></td> </tr> <tr> <td><div align="right">Folio Link:</div></td> <td><input type="text" name="foliolink" placeholder="Folio Link" /></td> </tr> <tr> <td><div align="right">Quote:</div></td> <td><input type="text" name="quote" placeholder="Quote" /></td> </tr> <tr> <td><div align="right">Deposit:</div></td> <td><input type="text" name="deposit" placeholder="Deposit" /></td> <tr> <td><div align="right">Status:</div></td> <td><select name="status"> <option value="Waiting On DJ">Waiting on DJ</option> <option value="Waiting On Customer">Waiting on Customer</option> </select></td> </tr> <tr> <td><div align="right"></div></td> <td><input type="submit" name="Submit" value="submit" /></td> </tr> </form> </table> the problem I am having is that the data is not updating. What am I doing wrong? thank you all!
  5. that still didnt fix it, this issue is really making me upset. Im going to post all codes now im done dealing with this. I have loops for some reason now. I am a DJ and I simply want the user to be able to log in to their account and see their information pulled from the register page and the mysql database. I would also like for the user to not be able to see others profiles. Here is the code for the global.php document found in all docs. All the connect.php doc includes is the db login information <?php include_once("connect.php"); session_start(); if(isset($_SESSION['username'])) { header("Location: home.php"); //checking if sessions are set. if(isset($_SESSION['username'])){ $session_username = $_SESSION['username']; $session_pass = $_SESSION['pass']; $session_id = $_SESSION['id']; //check if the member exists $query = mysql_query("SELECT * FROM clients WHERE id='$session_id' AND password='$session_pass'LIMIT 1") or die("Could not check member"); $count_count = mysql_num_rows($query); if($count_count > 0){ //logged in stuff here $logged = 1; }else{ header("Location: logout.php"); exit(); } }else if(isset($_COOKIE['id_cookie'])){ $session_id = $_COOKIE['id_cookie']; $sessions_pass = $_COOKIE['pass_cookie']; //check if the member exists $query = mysql_query("SELECT * FROM clients WHERE id='$session_id' AND password='$session_pass'LIMIT 1") or die("Could not check member"); $count_count = mysql_num_rows($query); if($count_count > 0){ while($row= mysql_fetch_array($query)){ $session_username = $row['username']; } //create sessions $_SESSION['username']=$session_username; $_SESSION['id']=$session_id; $_SESSION['pass']=$session_pass; //logged in stuff here $logged = 1; }else{ header("Location: logout.php"); exit(); } }else{ //if the user is not logged in $logged = 0; } } ?> this is the login.php page <?php include_once("scripts/global.php"); if(isset($_POST['email'])){ $email = $_POST['email']; $pass = $_POST['pass']; $remember = $_POST['remember']; //error handeling if((!$email)||(!$pass)){ $message = 'Please insert both fields'; }else{ // secure the data $email = mysql_real_escape_string($email); $pass = sha1($pass); $query = mysql_query("SELECT * FROM clients WHERE email='$email' AND password='$pass' LIMIT 1" ) or die("Could not check member"); $count_query = mysql_num_rows($query); if($count_query == 0){ $message = 'The information you entered is incorrect'; }else{ //start session $_SESSION['pass'] = $pass; while($row = mysql_fetch_array($query)){ $username = $row['username']; $id = $row['id']; } $_SESSION['username'] = $username; $_SESSION['id'] = $id; if($remember == "yes"){ //create cookies setcookie("id_cookie",$id,time()+60*60*24*100,"/"); setcookie("pass_cookie",$pass,time()+60*60*24*100,"/"); } header("Location: home.php"); } } } ?> this next document is the profile.php(what I have so far- im going to add when this starts working. <?php include_once("scripts/global.php"); if($logged == 0){ echo("You need to be logged in to view quote information"); } if(isset($_GET['id'])){ $id = $_GET['id']; }else{ $id = $_SESSION['id']; } //collect member information $query = mysql_query("SELECT * FROM clients WHERE id='$id' LIMIT 1") or die("Could not collect user information"); $count_mem = mysql_num_rows($query); if($count_mem == 0){ echo("The user does not exist"); exit(); } while($row = mysql_fetch_array($query)){ $username = $row['username']; $firstname = $row['firstName']; $lastname = $row['lastName']; $client_id = $row['id']; if($session_id == $client_id){ $owner = true; }else{ $owner = false; } } ?> home.php has no code except for the include(global.php) and finally the logout.php <?php session_start(); session_destroy(); if(isset($_COOKIE['id_cookie'])){ setcookie("id_cookie",",time()-50000,'/"); setcookie("pass_cookie",",time()-50000,'/"); } if(!isset($_SESSION['username'])){ echo("we could not log you out, please try again"); exit(); }else{ header("Location: index.php"); } ?> thanks all for help. I would like just everything to work and not loop. This might be a big error or something really small im just tired of trying to fix it Thanks!!!!
  6. alright so I have muliple different files and I think I know where my error is. I want to have my page set so that when a client logs in they they set the logged variable to 1 and not 0. So far whenever I log in the variable is staying at 0 there must be an issue. here is the global.php file <?php include_once("connect.php"); session_start(); if(isset($_SESSION['username'])) { header("Location: index.php"); //checking if sessions are set. if(isset($_SESSION['username'])){ $session_username = $_SESSION['username']; $session_pass = $_SESSION['pass']; $session_id = $_SESSION['id']; //check if the member exists $query = mysql_query("SELECT * FROM clients WHERE id='$session_id' AND password='$session_pass'LIMIT 1") or die("Could not check member"); $count_count = mysql_num_rows($query); if($count_count > 0){ //logged in stuff here $logged = 1; }else{ header("Location: logout.php"); exit(); } }else if(isset($_COOKIE['id_cookie'])){ $session_id = $_COOKIE['id_cookie']; $sessions_pass = $_COOKIE['pass_cookie']; //check if the member exists $query = mysql_query("SELECT * FROM clients WHERE id='$session_id' AND password='$session_pass'LIMIT 1") or die("Could not check member"); $count_count = mysql_num_rows($query); if($count_count > 0){ while($row= mysql_fetch_array($query)){ $session_username = $row['username']; } //create sessions $_SESSION['username']=$session_username; $_SESSION['id']=$session_id; $_SESSION['pass']=$session_pass; //logged in stuff here $logged = 1; }else{ header("Location: logout.php"); exit(); } }else{ //if the user is not logged in $logged = 0; } } ?> here is the login.php script <?php include_once("scripts/global.php"); if(isset($_POST['email'])){ $email = $_POST['email']; $pass = $_POST['pass']; $remember = $_POST['remember']; //error handeling if((!$email)||(!$pass)){ $message = 'Please insert both fields'; }else{ // secure the data $email = mysql_real_escape_string($email); $pass = sha1($pass); $query = mysql_query("SELECT * FROM clients WHERE email='$email' AND password='$pass' LIMIT 1" ) or die("Could not check member"); $count_query = mysql_num_rows($query); if($count_query == 0){ $message = 'The information you entered is incorrect'; }else{ //start session $_SESSION['pass'] = $pass; while($row = mysql_fetch_array($query)){ $username = $_row['username']; $id = $row['id']; } $_SESSION['username'] = $username; $_SESSION['id'] = $id; if($remember == "yes"){ //create cookies setcookie("id_cookie",$id,time()+60*60*24*100,"/"); setcookie("pass_cookie",$pass,time()+60*60*24*100,"/"); } header("Location: home.php"); } } } ?>
  7. well in the current script header() means if the variable matches send to whatever URL right? then exit() just clears the current script and moves to the next?
  8. yep the exit() was the issue.. I wonder how that got there.. Thanks again
  9. second file is login.php the script with the login credientials is connect.php which is included on global.php. I will move the session information below the include connect.php and remove the exit and see what happens. thanks
  10. alright, this is a big screwy problem that I am trying to fix. The first thing is that I have a global php document loading into all php documents. The code is as follows: <?php session_start(); if(isset($_SESSION['username'])) { header("Location: index.php"); exit(); include_once("connect.php"); //checking if sessions are set. if(isset($_SESSION['username'])){ $session_username = $_SESSION['username']; $session_pass = $_SESSION['pass']; $session_id = $_SESSION['id']; //check if the member exists $query = mysql_query("SELECT * FROM clients WHERE id='$session_id' AND password='$session_pass'LIMIT 1") or die("Could not check member"); $count_count = mysql_num_rows($query); if($count_count > 0){ //logged in stuff here $logged = 1; }else{ header("Location: logout.php"); exit(); } }else if(isset($_COOKIE['id_cookie'])){ $session_id = $_COOKIE['id_cookie']; $sessions_pass = $_COOKIE['pass_cookie']; //check if the member exists $query = mysql_query("SELECT * FROM clients WHERE id='$session_id' AND password='$session_pass'LIMIT 1") or die("Could not check member"); $count_count = mysql_num_rows($query); if($count_count > 0){ while($row= mysql_fetch_array($query)){ $session_username = $row['username']; } //create sessions $_SESSION['username']=$session_username; $_SESSION['id']=$session_id; $_SESSION['pass']=$session_pass; //logged in stuff here $logged = 1; }else{ header("Location: logout.php"); exit(); } }else{ //if the user is not logged in $logged = 0; } } ?> Now this page is loaded into my log-in page here: <?php include_once("scripts/global.php"); if(isset($_POST['email'])){ $email = $_POST['email']; $pass = $_POST['pass']; $remember = $_POST['remember']; //error handeling if((!$email)||(!$pass)){ $message = 'Please insert both fields'; }else{ // secure the data $email = mysql_real_escape_string($email); $pass = sha1($pass); $query = mysql_query("SELECT * FROM clients WHERE email='$email' AND password='$pass' LIMIT 1" ) or die("Could not check member"); $count_query = mysql_num_rows($query); if($count_query == 0){ $message = 'The information you entered is incorrect'; }else{ //start session $_SESSION['pass'] = $pass; while($row = mysql_fetch_array($query)){ $username = $_row['username']; $id = $row['id']; } $_SESSION['username'] = $username; $_SESSION['id'] = $id; if($remember == "yes"){ //create cookies setcookie("id_cookie",$id,time()+60*60*24*100,"/"); setcookie("pass_cookie",$pass,time()+60*60*24*100,"/"); } header("Location: home.php"); } } } ?> Now the first error is that I get is: Warning: mysql_real_escape_string(): No such file or directory in /misc/12/000/267/023/7/login.php on line 13 Warning: mysql_real_escape_string(): A link to the server could not be established in /misc/12/000/267/023/7/login.php on line 13 Warning: mysql_query(): No such file or directory in /misc/12/000/267/023/7/login.php on line 15 Warning: mysql_query(): A link to the server could not be established in /misc/12/000/267/023/7/login.php on line 15 Could not check member Now in result when I dont have global.php loaded and have connect.php loaded.- logging in works but there is no session set and the information from their row in the table is not available. Thanks
×
×
  • 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.