Jump to content

derrick1123

Members
  • Posts

    122
  • Joined

  • Last visited

    Never

Everything posted by derrick1123

  1. Try: <?php //next step var $step = $_POST['step']; //others $miles = $_POST['miles']; $kilos = $_POST['kilos']; $miles1 = $_POST['miles1']; //show the default form if($step==0 || $step==""){ echo "<html><head><title>Conversion</title></head><body>"; echo "<form method='POST' action='$_SERVER['PHP_SELF']' name='miles1'>"; echo "<h4>Convert miles into kilometers</h4> <br />"; echo "Miles into Kilometers <input type='text' name='miles' size='4' /> <br />"; echo "Kilometers into Miles <input type='text' name='kilo' size='4' /> <br />"; echo "<input type='hidden' value='1' name='step'>"; echo "<input type='submit' name='submit' value='Convert!' />"; echo "</form>"; } //show the results if($step==1){ if (isset($miles1)) { echo ""; } //Convert the data $mresult = $miles * 1.6; echo "$miles = $mresult Kilometers"; //Convert for Kilometers $kresult = $kilos * 0.6; echo "$kilos = $kresult Miles"; } ?> I didn't get a chance to test it out sorry...
  2. I know that thats why I thought he might be missing it, but it looks like it works now. ^.^
  3. <?php while($row = mysql_fetch_array($result)) { $tmp = array(); $tmp[] = $row['Est#']; //this is line 45 $tmp[] = $row['Est_Desc']; $tmp[] = $row['Price']; $tmp[] = $row['Price_Unit']; $tmp[] = $row['Quantity']; $tmp[] = $row['Quantity_Unit']; $tmp[] = $row['Unit_Rate']; $tmp[] = $row['Long_Desc']; $display_string = '<tr><td>' . implode('</td><td>',$tmp) . '</td></tr>"; } ?> I noticed the "}" missing.
  4. Can we see the whole PHP file? Just to make sure you have everything you need.
  5. Thank you for helping me, but here are my errors: Name error is coming from: Zero test Subject error is coming from: Zero test Warning: mail() [function.mail]: SMTP server response: 553 We do not relay non-local mail, sorry. in C:\xampp\htdocs\email\index.php on line 98 I think I know why the SMTP isn't working...
  6. Errors: Name Value:--sample name-- Email Value:--same@email.com-- Subject Value:--samle subject-- Message Value:--This is my very short sample msg. ^.^-- Error Message:Name Subject
  7. I like the design on your site ^.^
  8. Try: $clientname = $_POST['clientname']; $description = addslashes($_POST['description']); $price = addslashes($_POST['price']); $link = addslashes($_POST['link']); $using = addslashes($_POST['using']); $query = "UPDATE 'sales' WHERE clientname = '$clientname' SET clientname = '$clientname', description = '$description', price = '$price', link = '$link', using = '$using'"; mysql_query($query) or die(mysql_error()); echo "Edited Sale!";
  9. Eh, its ok. I am no were near ready to do something like that anyway. Thanks for your help though.
  10. Well if your using a shared database with other people, you have to use: $con = mysql_connect( 'localhost', 'MYNAME_username', 'MYPASSWORD') or die(mysql_error()); $db = mysql_select_db( 'MYNAME_dbname', $con) or die(mysql_error()); And you have to created the dbname and username and add permissions to them.
  11. Try and see if there is something wrong with mysql: functions.php <?php function protect($string){ $string = mysql_real_escape_string($string); $string = strip_tags($string); $string = addslashes($string); return $string; } function connect () { $con = mysql_connect( 'localhost', 'MYNAME', 'MYPASSWORD') or die(mysql_error()); $db = mysql_select_db( 'MYNAME_users', $con) or die(mysql_error()); } ?> This is starting to get weird... Sorry I couldn't help. ---- Do you use cpanel? If so I THINK I see the error.
  12. What? lol Sorry, I have been trying to understand what you said, but it ended up being confusing the more times I read it. My bad...
  13. Because you haven't given it anything to show: <?php error_reporting(E_ALL); include_once "functions.php"; connect(); if(!isset($_POST['submit'])){ echo "<table border=\"0\" cellspacing=\"3\" cellpadding=\"3\">\n"; echo "<form method=\"post\" action=\"register.php\">\n"; echo "<tr><td colspan=\"2\" align=\"center\">Registration Form</td></tr>\n"; echo "<tr><td>Username</td><td><input type=\"text\" name=\"username\"></td></tr>\n"; echo "<tr><td>Password</td><td><input type=\"password\" name=\"password\"></td></tr>\n"; echo "<tr><td>Confirm</td><td><input type=\"password\" name=\"passconf\"></td></tr>\n"; echo "<tr><td>E-Mail</td><td><input type=\"text\" name=\"email\"></td></tr>\n"; echo "<tr><td>Name</td><td><input type=\"text\" name=\"name\"></td></tr>\n"; echo "<tr><td>AIM Address</td><td><input type=\"text\" name=\"aim\"></td></tr>\n"; echo "<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" name=\"submit\" value=\"Register\"></td></tr>\n"; echo "</form></table>\n"; } else { $username = protect($_POST['username']); $password = protect($_POST['password']); $confirm = protect($_POST['passconf']); $email = protect($_POST['email']); $name = protect($_POST['name']); $aim = protect($_POST['aim']); $errors = array(); if (!$username) { $errors[] = "Username is not defined!"; } if($password){ $errors[] = "Password is not defined!"; } if($password){ if(!$confirm){ $errors[] = "Confirmation password is not defined!"; } } if(!$email){ $errors[] = "Email is not defined!"; } if(!$name){ $errors[] = "Name is not defined!"; } If (!$aim){ $errors[] = "AIM Screename is not defined!"; } if ($username) { if(!ctype_alnum($username)){ $errors[] = "Username can only contain numbers and letters!"; } } if($password && $confirm) { echo "IT WORKS!"; } } ?> I think thats were it goes...
  14. TRY: if($_POST['submit']){ I don't know why...but try it.
  15. Could you do a browser type in an image? I have seen it before, but don't know how its done.
  16. And after you do that, give us the errors you receive.
  17. Looks like you only gave it a place to show errors, but not a place to show it has worked.
  18. I had written a folder maker...although I don't think that is what your talking about >.<
×
×
  • 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.