Jump to content

whizard

Members
  • Posts

    48
  • Joined

  • Last visited

    Never

Everything posted by whizard

  1. $days_left = $date_expiry - $date_today; if($days_left > 3) { $msg = "You have ".$days_left." of your Trial."; } elseif($days_left < 3 && $days_left > 0) { $msg = "Warning: You only have ".$days_left." of your Trial."; } elseif($days_left = 0) { $msg = "Warning: Today is the last day of your Trial."; } else { $msg = "Your free Trial has expired. Please subscribe"; } HTH Dan
  2. Try $cookieUser = $_GET['user']; $cookiePass = $_GET['password']; $sqlUser = 'SELECT user, passmd5 FROM users WHERE user="'.$cookieUser.'"'; $result = mysql_query($sqlUser) or die(mysql_error()); $userData = mysql_fetch_array($result, MYSQL_ASSOC); if($userData['user'] == $cookieUser && $userData['passmd5'] == $cookiePass) { //Success! What it should be doing } that should give an error if the query is wrong.
  3. true. someone's bored. 0-o and I didn't mean to be rude myself, so my apologies, linux.
  4. Try this: http://php.resourceindex.com/Documentation/Examples_and_Tutorials/Form_Processing/ (I would start with the first link, not the second about feedback forms) and this: http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q=feedback+comment+form+PHP+tutorial I'm not tryna just send you away, just there's no point in me writing a four page tutorial when there are hundreds out there already. Dan
  5. ok, true that this is probably off-topic, and that is was misspelled, but there's no call for that type of condescension here. Especially as your very second post in an online community. Dan
  6. you need to a)set up the HTML form b)set up a PHP script which takes the variables from the form c)continue in the same PHP script to insert the data into a database d)set up your homepage so that it gets the feedback out of the database and puts in on the homepage/wherever. There are hundreds of tutorials and things online for this. Dan
  7. define "doesn't work" Do you get an error message? What specifically happens?
  8. It doesn't matter if its an include page or line one of index.html in root. It doesn't matter if its HTML, XHTML, CSS, XML, or anything else. There's still no such thing as an <h7> tag.
  9. oh.... then, you should be able to write an .htaccess for that, I think. There are a few websites that can even spit out the correct .htaccess for you on google.
  10. and... there's no such thing as an <h7> tag...
  11. That's a subdomain. Your host's CP should have a tool for setting them up. Dan
  12. use the header command in your PHP before any output is sent to the browser (IE print or echo statemnt, etc): header("Location: thankYou.html"); HTH Dan
  13. Each browser has its own form elements. You can't control how they look, besides setting basic attributes like size and background color with CSS.
  14. index.register.username.focus(); should be document.register.username.focus(); document is a keyword. since theres only one document, it automatically assumes its the current file. This goes in the body, wherever. (with the <script> tags around it, obviosly) HTH Dan
  15. That's not an error, its a notice, which is a non-fatal message which just gives you information about an irregularity in your script. In this case, the first time the script goes through the foreach loop, it is asked to append "Checked: $value\n"; to the variable $check_msg, which doesn't exist, hence the undefined error. To fix it, just add $check_msg = ""; before the foreach loop. Also, you are getting the text about if(isset..... because you have it written outside the closing PHP tag. Dan ahh... beaten by bluejay.
  16. javascript: <script language="JavaScript"> <!-- document.the_form.u_input.focus(); //--> </script> HTH Dan
  17. Just get in the habit of using double equals signs. When I was still a complete noobie, I had a giant if/elseif statement with about 30 cases (not knowing about switch statements *rollseyes*) and they all had a single equals sign, so the last or first condition or something like that was always selected no matter what I gave the code. Ever since then, I've never forgotten an equals sign on a comparison test. Dan
  18. I don't think this is possible. PHP can't really control hardware issues. See this thread: http://codingforums.com/showthread.php?t=142187
  19. The checkboxes that you want to have associated with each other all need the same name, as well as empty brackets ( [] ) like this: <input type="checkbox" name="group1[]" value="Pops"> Pops <input type="checkbox" name="group1[]" value="Classics"> Classics Then PHP will get an array, $_POST['group1'] which will hold all the values that were checked. If no values are checked, then the array will be null. Also, you are assuming the values from the checkboxes are in variables already. If register_globals is off, they will not be accessible through $Pops, but rather through $_POST['checkbox name']['value'], as described above. and actually you're not overwriting the value of $htmlmsg each time. HTH Dan
  20. What do you mean, handle sessions?
  21. Technically he's not incrementing the variable, he's sending the value of the variable plus one. But anyhow. And like DarkWater said, don't use short tags. Dan
  22. You still need to increment $number or it will keep linking to the same pic.
  23. That's more or less what I was getting at. However, you will need to increment value so that you always go to the next photo and not the same one over and over again. I'm not a big fan of $_GET, so I would do it like this: <?php $value = $_POST['value'] $dir = './mangareader/bleach/chapter1/'; $images = count(glob("$dir{*.jpg,*.JPG,*.png}", GLOB_BRACE)); //Somewhere in here you need to actually show the image, correct? echo 'You are on page '. $value . ' of ' . $images; ?> //You will pass newValue back through the hidden form field and that will be the next picture. $newValue = $value++; ?> <form action="<?php print $_SERVER['PHP_SELF']; ?>" method="post"> <input type="hidden" name="value" value="<?php print $newValue; ?>" /> <input type="submit" name="submit" value="Next"> </form> </br> <?php echo "<img src=\"./mangareader/bleach/chapter1/$value.png\">"; ?> HTH Dan
  24. Where is $number getting its value? When u click submit, it reloads the page. All the variables will be reset. You might want to set a hidden form value with the current number and then increment that. Dan
  25. I think he meant $countmore=count($array_name[$i]);
×
×
  • 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.