Jump to content

schilly

Members
  • Posts

    870
  • Joined

  • Last visited

    Never

Everything posted by schilly

  1. well if you don't want the page to reload you'll have to look into AJAX. basically a form with one field and a submit button. use ajax to submit the form to your php script that checks the postal code and returns yes or no.
  2. have you tried sending it to yourself to verify?
  3. well use checkboxes then loop through and concatenate each value together with some kind of separator "-" "_" or whatever. so you would have red-blue-green etc. store than in the db then if you need to output that data just use the explode fn on your separator character.
  4. set a cron to check every 4 days?
  5. delete it off the server then upload it. post the code around that include as well.
  6. form example. for checking for a submit I use isset() but if I want to see if a field is blank, I use empty().
  7. hmmm good question. I'd like to see a good answer. From the manual anyways: empty() The following things are considered to be empty: "" (an empty string) 0 (0 as an integer) "0" (0 as a string) NULL FALSE array() (an empty array) var $var; (a variable declared, but without a value in a class) Where as isset(): any of the above would be considered true except NULL I think or the variable not existing. I think it really depends what you are trying to compare.
  8. there's an error here as well. no closing quote. $get=mysql_query("SELECT count(id) FROM login WHERE user='$user' and pass='$pass'"); post your file again and the errors.
  9. you should check with your service provider on how to set up crons with them.
  10. and this to the top of your file and see if you get any errors ini_set ("display_errors", "1"); error_reporting(E_ALL);
  11. well if config is only included there then just put that line in the config.
  12. well you could set up a variable in your class <?php class Account { public var $admin; public function __construct() { include("Config.php"); $this->admin = "myemail@domain.com"; } /** * sends an email to the $admin in Config.php * @returns true or false */ function sendMessage($theMessage, $userData) { $email = $userData['email']; $userID = $userData['userID']; $names = $userData['names']; $org = $userData['organization']; $headers = "From: $email\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1 "; $headers .= "MIME-Version: 1.0 "; $msg = "[ClientID: $userID] - $names from $org has sent you a message through the support form:<br/>"; $msg .= mysql_real_escape_string($theMessage); $send = mail($admin, "[Client Login] Message from $names - $org", $msg, $headers); if ($send) { return true; } else { return false; } } } ?> use $this->admin to access it in your send fn
  13. did you write a session class?
  14. you have an extra round bracket at the end of your if statement. only need one. if (isset($_POST['submit']) && $_GET['login'] == "yes") {
  15. if (isset($_POST['submit']) && $_GET['login'] == "yes")) { has an extra bracket.
  16. it sounds like you're login is working fine. when you use the header() fn you can't echo anything to the browser before it gets called. So you need to put your whole login code block above your html. your HTTP_REFERER may be putting you back to the same page as well as the POST came from your login page so you probably want to set that variable before the form submit.
  17. First off, don't post your mysql user/password info. There is a few errors in your code: <?php $user=$_POST['user']; $pass=$_POST['past']; $login=$_GET['login']; if($login=='yes'){ $con=mysql_connect('p80mysql90.secureserver.net','AmieAmie88','SexyAmieTits88'); mysql_select_db('amiedata'); $user=mysql_real_escape_string($user); $pass=mysql_real_escape_string($pass); $get=mysql_query("SELECT count(id) FROM login WHERE user='$user' and pass='$pass'"); $result=mysql_result($get, 0); mysql_close($con); if ($result!=1) echo= "Invalid Login!"; else{ echo"Login Success!"; $_SESSION['user']=$user; } } ?> Now to your questions: 1. It looks like you have the just on it down with your form. You don't need the login $_GET variable though. You can just post the form back to index.php and check for the name of your submit button in your $_POST vars (your submit button needs a name first) 2. You will need a page to create accounts. Similar to what you have now but you just want to enter the form data into your user table. 3. You can do any CSS you want =) 4. look up the header() function and you can redirect people to where ever you want. Make sure you don't echo anything before you redirect them or it won't work. ie. header("Location: navigation.php"); A couple things I suggest you read up on: - how to properly set up a secure login form - how to properly filter form submissions - how to prevent mysql injections from forms Other than that. Good start.
  18. It's hard to say. Each credit card company has their own methods. It's usually by API calls or a form redirect but I would say you never would include your password in the form. ie. PayPal use to just use username but I think they switched to some kind of user code now for Express Checkout and they have an API for calls from your own site. all use https and no where is there a visible password. I would contact them directly, check their documentation or find a new payment merchant.
  19. +1. For a credit card company to have something like that is unthinkable, hence my reply.
  20. I can hardly believe that's the code the credit card processing site gave you to redirect them?
  21. use a form and send the posted attachment in an email?
  22. putting special characters in your filenames is just asking for trouble. can't you leave them out? why would you put the price in the filename?
  23. well when you put it back in the textarea you don't want to display the <br /> tags to the user. just do a find replace when it goes into the textarea to change the <br /> back to \n then when they submit the form again run nl2br again. that make sense?
  24. ok can you post the output of this <?PHP echo "<pre>" . print_r($_POST,true) . "</pre>"; $item=$_POST['title']; foreach ($item as $itemname) { $query = mysql_query("SELECT * FROM `menu` WHERE title = '$itemname'"); while($row = mysql_fetch_array($query)) { $total = $total + $row['price']; echo "<p>" . $row['title'] . " - <span style=color:#000;>$" . $row['price'] . "</span></p>"; $allitems = $row['title'] . $row['price']; $_SESSION['items'][] = $allitems; $_SESSION['total'] += $total; } } echo "<pre>" . print_r($_SESSION,true) . "</pre>"; ?>
  25. oh i see. well each time you loop through that while you are overwriting the session var from the previous loop. so you might want to do something like: $_SESSION['items'][] = $allitems; $_SESSION['total'] += $total; that will add up the total and create an array of items.
×
×
  • 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.