Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. Same here. If you use ctype_alnum, it would be more difficult to modify than using a regex from the start. But, yes, in this case ctype_alnum, would be ideal.
  2. Need another '}', the first one is for the while loop but you don't have a terminating curly for the if. } } elseif($username == '') {
  3. Now the foreach for $supp_id_out is missing...
  4. That means your query is failing. Did you change the other line as well? Could you post your current code?
  5. session_start();s You have an extra 's' in test2.php, is that a typo?
  6. Change this line to: (notice the dot) $query .= substr ($query, 0, -1) . ') '; You can get descriptive SQL error messages by changing this line to: $result = mysql_query($query) or die(mysql_error());
  7. Oh I see. Many people tend to use backticks ` but they are only needed when you're using a reserved word for a table name or field.
  8. Above this line: while ($row_cl = mysql_fetch_assoc($result_cl)){ You need to add: $supp_id_out = array(); And change this line to: $supp_id_out[] = $row_cl["supp_id"]; Without initializing $supp_id_out as an array, it will always be a string with the value of the last record that's pulled from the database.
  9. Hmm, looks the same as before... At least it works now
  10. Yeah I've seen a couple on these forums and a lot on Google. Here's one
  11. 6th instance, I only see 3... Sorry, I don't understand what that mean. Can you give an example?
  12. Check out this basic tutorial: PHP and AJAX MySQL
  13. - If your search did not get any results, and you click "search again" it would be nice it the fields were auto-populated with your previous criteria.
  14. What's wrong with using something similar to what you had? $fp = "[Querying whois.arin.net] [Reirected to whois.ripe.net:43] [Querying whois.ripe.net]"; if (strpos($fp,"Redirected")){ echo $fp; } ?>
  15. Like revraz said, you probably want $supp_id_out to be an array that's created from the while loop. Try changing this portion: $supp_id_out = array(); while ($row_cl = mysql_fetch_assoc($result_cl)){ $supp_id_out = $row_cl["supp_id"]; $qty_out = $row_cl["qty"]; } foreach($supp_id_out as $key => $value) { $qty1 = $qty_out; $pid = $key; // add to the cart session variable $_SESSION['cart'][$pid] = $qty1; }
  16. $currentline=preg_replace('/(,\n)$/',n'', $test);
  17. Change this line to add whatever the column for their real name is: $LoginRS__query=sprintf("SELECT realname, username, password FROM users And add a session variable to carry the real name. //declare two session variables and assign them $_SESSION['MM_Username'] = $loginUsername; $_SESSION['MM_UserGroup'] = $loginStrGroup; $_SESSION['MM_RealName'] = $LoginRS['realname']; On the page you would like to display the real name you can just use: echo "Welcome " . $_SESSION['MM_RealName']; As long as you have session_start(); at the top of your page.
  18. That's because $supp_id_out is a string and foreach takes an array.
  19. Add a '\n' after the comma in the regex and it will pick up the comma then newline.
  20. It's good to suppress errors on a production server, but when you're trying to debug then you want to see these errors so you can fix them.
  21. That may be a problem, cause you need the processing script where it checks to see if their username and password match. Are you using some sort of template or third party script? They may have the username in the session already. If they do you have do something like this to see what session variables are set. session_start(); print_r($_SESSION);
  22. This will get rid of any comma that is at the end of a string: $d = "D,2796,Son,OlerCo.Kildare,"; $currentline=preg_replace('/,$/','', $d); echo $currentline;
  23. You mentioned earlier that you stored their information in the DB when they registered. So, wherever you authenticate their username and password when they log in, grab their real name from the DB and store it in a session.
  24. Try: $query = "SELECT t.*, c.* FROM cart_items i, cart_categories c ". "WHERE i.pn_cid=c.pn_cid";
×
×
  • 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.