Jump to content

gizmola

Administrators
  • Posts

    5,945
  • Joined

  • Last visited

  • Days Won

    145

Everything posted by gizmola

  1. header Use the http location header.
  2. In ( 1, 2) is exactly the same as product_id = 1 OR product_id = 2.
  3. That syntax should not be used. Back in the PHP4 days, the way objects were passed required the use of & in many cases, but in PHP5 all objects are passed by reference. In PHP there aren't really pointers, but the general idea is the same -- making a copy of a data structure vs. using the actual data structure. Objects are automatically passed by reference now.
  4. I'm afraid I can't be much help, I don't have any installations of php under windows.
  5. That's great, you pasted in two class definitions. Where is your code that is actually using these classes, and what did you try already that doesn't work?
  6. Probably this is what you would want to look into: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_IntroducingExpressCheckoutDG
  7. A checksum exists to validate the distribution. It is not a key. It's included so that people can run the checksum on the files they have and verify that someone didn't go in and screw around with the contents. If you don't have the password to decrypt the GPG file, you are out of luck. http://www.madboa.com/geek/gpg-quickstart/ I'm guessing from the way you're beating around the bush there is some reason that you don't have it, like this is a commercial package you didn't buy, or something like that. Please don't waste our time further. This forum is for people to learn PHP development.
  8. Haha, I just sat back while Ken did all the work... sorta like management.
  9. no I was asking if the number always follows the /d/ in the url. Also check out Ken's code... a very high performance solution to it, not that it matters that much for one call whether it's optimal, but that is good code and uses some nice php functions there.
  10. You are definitely way off. Why don't you start by explaining what your current code is doing, and why you are checking $_REQUEST['username'] == "infs"? If this is reached via a POST then don't use $_REQUEST.
  11. Is it always the number here? d/....../
  12. http://devzone.zend.com/article/3336-Reading-and-Writing-Spreadsheets-with-PHP
  13. Put a php block around the expression you want to evaluate. mysql_query ("UPDATE liga1 SET puncte='{$pctsteua + 3}', m='1', v='1' WHERE echipa='Steaua' ");
  14. I say again, SEO and traffic are 2 different things. You can buy traffic by advertising and marketing. http://www.topseos.com/rankings-of-best-seo-companies
  15. Traffic and SEO are 2 different things.
  16. what part of that string is the username?
  17. Because php typecasts, even when you return strings or numbers they will get typecast to something that works. However, depending on this behavior is a bad idea, and the results of a typecast boolean is frequently not what you would expect it to be, so no that's not good maintainable code. When people write books they often will put in extreme examples to illustrate the point they're trying to make.
  18. I don't think you understand what I was saying. Looking at your code, there's a point where you process the login due to having data from a post, you do a database lookup, you set set a bunch of session variables and the remember me cookie. Great -- these are things you need to do. Then the script ends. If you don't redirect to the "logged in page" you're sitting looking at a blank page. This explains why when you refresh suddenly you are "logged in". You need to redirect once you complete that work.
  19. You have an extra single quote on height='38''. Should be ='38'
  20. There is a lot of stuff wrong with your initial form script. -First off, you want to query only by the email address when looking for someone. You should add a unique index in the mysql table on the email column to make sure mysql won't allow 2 rows with the same email address to be enetered. -you call mysql_insert_id() 2x in a row. You can't do that. You call it, you get the last inserted id. Call it again you will get an error -- it's a 1 shot, per insert deal. -Your main problem right now is that you are setting the $_SESSION['id'] in the wrong place, and your assignment is wrong. I don't have much time, so i gave a guick pass and tried to fix what I could. error_reporting(E_ALL); ini_set("display_errors", 1); include_once ("Connections/connect_to_mysql.php"); $err=''; $id=''; $firstname=''; $lastname=''; $password=''; $country=''; $email=''; if(isset($_POST["submit"])){ // Validate form data if($_POST["firstname"]=='') $err.='Please enter First Name '; if($_POST["email"]=='') $err.='Please enter Email '; if($err==''){ // Check if there are duplicate entries in the 'contacts' table $sql_check = mysql_query("SELECT id FROM `Members` WHERE Email='".mysql_real_escape_string($_POST["email"])."'"); if($row = mysql_fetch_array($sql_check)){ $err.='Can not add duplicate entry '; } else { // adding new record to 'contacts' table $results = mysql_query("INSERT INTO Members (firstname,lastname,password,country,Email) values ('".mysql_real_escape_string($_POST["firstname"])."','".mysql_real_escape_string($_POST["lastname"])."','".mysql_real_escape_string($_POST["password"])."','".mysql_real_escape_string($_POST["country"])."','".mysql_real_escape_string($_POST["email"])."')") or die (mysql_error()); if($results){ $userid = mysql_insert_id(); $_SESSION['id'] = $userid; // redirecting to success screen header("Location: login.php"); } else { die(mysql_error()); } } } } ?> Add New Contact Register with us ' '.$err.'') ?> </pre> <form method="post" action="form.php"> First Name: Last Name: Password: Country: Email: </form> <br><br><b
  21. There is no mystery to the problem -- the query will not be valid if the query is not valid, and currently it is missing a value for the id. Stepping back for a minute, I made some assumptions based on your code as provided. How many scripts do you have, and when is this script being called. I assumed it was a script that was called AFTER you login with another script, AND that assigns the user id to a session variable named $_SESSION['id']. IF that assumption is incorrect this query will not execute.
  22. Yeah that's a quantifier for the character class that preceeds it (the stuff inside the [] is called a character class). The character class is defining characters and ranges of characters that the regex is trying to match. The {} after it is quantifying how many times it is looking to match. There are a lot of different variations to these quantifiers. This site is a great reference: http://www.regular-expressions.info/reference.html That particular quantifer means "most match at least 4 times". That closing paren closes out a capture group for the pattern: ([a-zA-Z0-9-!@#$^&*:"/?]{4,}) So everything inside the () will be captured together. This is what gets substituted for the $1 in the rewrite. Since it's the first captured group (or in this case the only captured group) It becomes $1. search.php?q=$1
  23. Html doesn't allow you to embed image data into it -- it uses the img tag.
  24. What is the weird stuff in your code snippet. That is not actually in there is it? [color=gred]elseif ($this->_os === "windows") { $content = ""; if ($count > 0) { $content = fread($this->_dHandle, $count); } return $content; }[/color] I'm referring to the color=gred and /color tags that seem to have gotten in there erroneously.
×
×
  • 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.