Jump to content

WebStyles

Members
  • Posts

    1,216
  • Joined

  • Last visited

Everything posted by WebStyles

  1. this is all you need: (except you need to specify the path to mysqldump correctly) $u = 'username'; $p = 'password'; $db = 'databasename'; system("/Applications/MAMP/Library/bin/mysqldump -u$u -p$p $db > test.sql");
  2. your code works for me (replacing all addresses, of course). Check your spam box. echo all variables and check their values.
  3. you're still going to need session_start(); in that file.
  4. put session_start(); at top of file.
  5. still the same problem... where does the ELSE come from? change this: if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php" $_SESSION["myusername"] = $myusername; //copy $myusername to $_SESSION['myusername'] $_SESSION["mypassword"] = $mypassword; //copy $mypassword to $_SESSION['mypassword'] $_SESSION["country"] = $country; $_SESSION["state"] = $state; } header("location: login_success.php"); else { echo "Wrong Username or Password"; } to this: if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php" $_SESSION["myusername"] = $myusername; //copy $myusername to $_SESSION['myusername'] $_SESSION["mypassword"] = $mypassword; //copy $mypassword to $_SESSION['mypassword'] $_SESSION["country"] = $country; $_SESSION["state"] = $state; header("location: login_success.php"); }else { echo "Wrong Username or Password"; }
  6. you have 2 closing bracket after your ELSE statement, and none before... you have this: if(){ ... else{ ... } } you should have: if(){ ... }else{ ... }
  7. because that script relies on 3 external files that you don't seem to have: config.php, opendb.php and closedb.php the error says: "No such file or directory"
  8. "Do or Do not, there is no try" -- Yoda
  9. yes, it's possible, and yes, I back up my databases. what I normally do is tar -czf the entire mysql folder. I actually have a cron tab set up to do this every day at midnight. you can do the same with php, or you could dump the database to a csv file.
  10. there HAS to be a response, even if it's just an error in your logs. my guess is the connection. check your error logs to see what went wrong.
  11. yep... lol. except my code will work and yours wont (you left the backticks)
  12. change this: $query = "INSERT INTO `profs` (`rating`) VALUES (`rating`)"; to this: $query = "INSERT INTO `profs` (`rating`) VALUES ('$rating')";
  13. if you can mount the network drive on the server, then all you need is copy($src,$dest); (as long as the share has the appropriate permissions)
  14. you place the if statement just like I showed you in my example. your_var_here needs to have the value you put into name="whatever" when you create your <select... box..
  15. you need to add 'selected' like this: $select .= "<option value='$file' selected>$file</option>\n"; so, basically, when you're looping through and building the dropdown menu, you compare the value with the one that was posted, and add ' selected' if necessary: $select .= '<option value="'.$file.'"; if($_POST['your_var_name'] == $file) $select .= ' selected'; $select .= '>'.$file.'</option>';
  16. There's no way that code was working.... I've corrected a few things, but haven't tested it. (you should find out where your logs are and make a habit of checking them while coding, it will make your life easier) * comments in code: <?php include("config.php"); // localhost needs to be enclosed in quotes $con = mysql_connect("localhost",$username,$password); // added $con to mysql_select_db parameters mysql_select_db("frontstep",$con) or die( "Unable to select database"); // assuming this is correct, I have no way of knowing $sql1="SELECT clients.clientID,clients.clientName, workOrder.clientID FROM clients, workOrder WHERE clients.clientID = workOrder.clientID"; // added connection resource $result2 = mysql_query($sql1,$con); // also, no way of knowing if this is correct, although it seems a bit "MUCH" if all you want is the clientID $sql2="SELECT clients.clientID,clients.clientName, workOrder.clientID FROM clients INNER JOIN workOrder ON clients.clientID = workOrder.clientID WHERE workOrder.workOrderID = '$workOrderID'"; // added connection resource again $result3 = mysql_query($sql2,$con); $row = mysql_fetch_assoc($result3); $selectedID = $row["clientID"]; while ($row=mysql_fetch_assoc($result2)) { // just changed a few things and added $options.= before ' selected' $options.='<option value="'.$row["clientID"].'"'; if($row["clientID"] == $selectedID) $options .= ' SELECTED'; $options.= '>' . $row["clientName"] . '</option>'; } ?> <select name="workOrderClient"><?php echo $options;?></select> try running this code and check your error logs! (if you're using mamp, xamp, or wamp, you'll have a folder somewhere in there called logs, if your on a linux server, check in /var/log or similar)
  17. maybe this will help you: http://www.phpclasses.org/package/1076-PHP-A-class-to-crop-images-in-a-variety-of-ways-.html (30 seconds on google and I got hundreds of pages with tutorials on how to crop images)
  18. use $_POST if your form method is post, $_GET if form method is get, and $_REQUEST if you're not sure. not needed here, because it's only 1 statement. $option is obviously a typo. should be $options
  19. echo this anywhere else in the code: echo '<script>setTimeout('delayer()', 5000);</script>';
  20. well if the <body> tag is inside header.php, put <body onLoad="setTimeout('delayer()', 5000)"> inside header.php and remove from main file.
  21. what code is in header.php ?
  22. what do you mean? where does header.php come form, what code is in it?
×
×
  • 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.