Jump to content

davidannis

Members
  • Posts

    627
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by davidannis

  1. $curYear = date(Y); as pointed out previously by ginerjm you should put the Y in quotes.
  2. No, you need to do a bit more work on your own, try writing it, and if you run into problems we'll be glad to help.
  3. The true checks not just that it is in the array but also that it is the same type (string, numeric, boolean) which is what I meant by "Try using in_array without the true to see if it is the type that is causing it to fail." The default is to not require that type match. No matter what you set that third parameter to the return value of the in_array() will be a boolean that is true if the value is in the array (and type is the same if you put ", true" at the end) or false if the value is not in the array.
  4. Also, $years[$aSearch] won't work as you expect since in_array just returns true or false, not the position in the array. http://php.net/manual/en/function.in-array.php
  5. $aSearch = in_array($curYear, $years, true) did you mean to assign the value here? Try using in_array without the true to see if it is the type that is causing it to fail.
  6. Or you can try the freelancer section of the forums if you want to hire somebody to create a commercial product. I'd recommend against that market because it already has strong competition.
  7. You need to encode the # ?hashtag=%23xbox You can find an explanation here or Google it.
  8. Are you asking how to execute multiple queries using only one php command? See the documentation for mysql here: http://php.net/manual/en/mysqli.multi-query.php
  9. <input type="text" name="domain"><br> <input type="checkbox" value=".com" name="tld[]">.com<br> <input type="checkbox" value=".net" name="tld[]">.net<br> <input type="checkbox" value=".org" name="tld[]">.org<br> foreach($_POST['tld'] as $value){ echo $_POST['domain'].$value."<br>\n"; } will give you what you are looking for, output to the screen I believe. Of course, you need the rest of the HTML and the php, only provided the relevant pieces here.
  10. Let's start with the basic idea. You need to name your variables in the html as an array <input type="text" name="nrp[]"> then you loop through the array that you get and write the records: foreach($_POST['nrp'], as $value){ WRITE YOUR RECORD HERE }
  11. I'll give you this much http://php.net/manual/en/function.substr.php and you can nest functions like this: $myvar=strtoupper(substr(GUESS WHAT GOES HERE));
  12. Try something and if you have trouble we'll help. We won't do it for you though. Start with the manual.
  13. Does it print an error message? Does it print "Message successfully sent!"? Is php error reporting on? (If not, put this at the top of your php file:) error_reporting(E_ALL); ini_set("display_errors", 1);
  14. Use LIKE in your query. WHERE date_mod LIKE '$date%';
  15. If your database name has a space in it you need backticks around it.
  16. Please when you do var_dump($sql); as suggested, show us what you get. I am wondering if you are putting the correct value into the form that creates $_POST. Try using backticks in the form so $_POST['selform'] will contain `databasename`.`head`
  17. Posted criticism of a website in Miscelaneous. Can you tell I'm angry? ;) I'll get over it.

  18. I make my share of programming design blunders, as many of you know from helping me debug a few, so I am hesitant to point fingers, but I just had an experience so horrible, with so many errors on a website owned by Snapfish (which should have some programming resources) that I had to write it up.
  19. You need to sanitize $table (as previously discussed): $table = mysqli_real_escape_string($con,$_POST['selform']); The error is telling you that the query is failing. Perhaps $table doesn't have the value you expect. Try this: $sql = 'SELECT * FROM '.$table ; echo $sql.'<br>'; $result = mysqli_query($con,$sql);
  20. An example might look like this: $lastpage=3; for ($counter = 1; $counter <= $lastpage; $counter++){ echo "We're on page $counter <br>"; } echo "done"; which would output We're on page 1 We're on page 2 We're on page 3 done
  21. I'm not sure what situation they won't work in, but if you can't read the test cookie you wrote then you won't be able to read the preference cookie that you wrote. The browser doesn't know that the cookie is a test. I would just have the page after they set the preference cookie try to read the preference cookie and if it is not found tell them that you couldn't store their preferences for the next time and suggest that they may need to enable cookies.
  22. Why is the action on the form: form action="login_submit.php" different from the name of the name of the script that you supplied? login.php
  23. There are a lot of good introductions to programming on the web. Read one and start trying. If you run into specific problems we'll be happy to help.
  24. need quotes around src=blah so it is src="blah" <img src=../'.$row['ppic'].' should be <img src="../'.$row['ppic'].'"
  25. You get a bunch of data from PayPal via IPN. It comes as $_POST. First step is to sanitize that data and send it back to them via curl and they will verify that they sent it. (They provide sample code that does that). In their sample code the curl response is stored in $res. First you look for VERIFIED at the start of $res. If $res is not VERIFIED -- log the transaction and investigate. If the data you got is what they sent you can compare the various values to what you were expecting to get. I would look at payment_status to make sure it shows completed and mc_gross (how much the total transaction was for) mc_currency. I use a pass through variable invoice that I pass a unique value to them and they pass it back to match the transaction in my database. They warn you to do your DB updates after the curl verification because it times out pretty quickly if they send data and are not asked for a confirm. A complete list of all the data that they may send you is at https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNandPDTVariables/
×
×
  • 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.