Jump to content

cyberRobot

Moderators
  • Posts

    3,145
  • Joined

  • Last visited

  • Days Won

    37

Everything posted by cyberRobot

  1. Assuming that I'm followed the code correctly, it looks like you are wondering why the username and password aren't being passed to "teacher/index.php". Is that correct? To get the username and password to "teacher/index.php", you'll need to create SESSION variables in the script which processes the form (cargar_login.php). It looks like you already created a SESSION variable for username here: $_SESSION['usuario'] = $user; Then in your "teacher/index.php" script, you'll need to use the SESSION variables instead of POST. So this: $usuario = $_POST['user']; Would be this: $usuario = $_SESSION['usuario'];
  2. Is this what you are looking for? <a href="mailto:somebody@gmail.com?body=Hello World">Sombody</a> If so, the following search results may help guide you further: https://www.google.com/#q=mailto%20populate%20message%20body
  3. To redirect users to their own specific pages, you could tie their URL to their login. Then you just need to use the header() function to redirect a user once they log in.
  4. When including array variables like $row['Scott'] in a string, they need to be surrounded by curly brackets. You'll need to change lines like this to <td>$row['Scott']</td> To this <td>{$row['Scott']}</td>
  5. Sorry I don't know of any classes. In case it helps, I found the books by Eric Meyer to be very helpful: http://meyerweb.com/eric/books/
  6. I remember saying that before. Are you sure there will never be more than 3 users? If you don't use a database or PHP, how are you planning to prevent user 1 from viewing the other user's pages? What about everyone else? At some point, someone may discover what the pages are named and type an address directly.
  7. Out of curiosity, what's the goal behind the strlen() check? Is it just checking that $email contains a somewhat valid email address? Perhaps you're already aware of this, but PHP has a built-in function for validating email addresses: http://php.net/manual/en/filter.examples.validation.php
  8. If you want to use JavaScript, here's a quick example: http://javascript.about.com/library/bldydrop1.htm
  9. Sorry, I probably made the wrong assumption here. Are you asking about the newline character? In so, characters like "\n" need to be enclosed in double quotes if you want them to act like newlines. Note that if you're expecting this newline character to appear in a web page, you'll need to use an HTML tag like <br> instead. The newline character only appears in the source code for an HTML page.
  10. That line of code uses the ternary operator. More information can be found here: http://php.net/manual/en/language.operators.comparison.php#language.operators.comparison.ternary
  11. Side note: using the raw value from PHP_SELF in anchor tags makes your script vulnerable to XSS attacks. http://www.cyberscorpion.com/2012-03/why-php_self-should-be-avoided-when-creating-website-links/
  12. I've been experiencing similar issues. I replied to the following a topic earlier today: http://forums.phpfreaks.com/topic/290295-html-layout-for-php-form/?do=findComment&comment=1486989 Originally, there were only one reply. But sometime after making my post, another reply came in from the OP. This mystery reply has a date from last night, so it appears before mine...but it came in after mine.
  13. Perhaps I'm missing something, but you didn't provide any details on the potential solution.
  14. Could you provide a little more information on where you are stuck? In case you're just looking for a quick tutorial on working with radio buttons, the following tutorial may help: http://www.tizag.com/phpT/examples/formex.php Note that the tutorial talks about using PHP_SELF in the form's action attribute. Using PHP_SELF in this manner opens the page up to XSS attacks and should be avioded. More information can be found here: https://www.google.com/search?q=php_self%20xss
  15. Could you provide a little more information on what you're trying to format? It kind of sounds like you want to format the email message sent by the script. Is that correct?
  16. You could have some sort of database (or array) which contains all of the images. Each image will need an unique ID and point value. When displaying the 3 to 5 images from the database, each image would be surrounded with an anchor tag that includes the image's ID. For example: <ul> <li><a href="yourscript.php?imageID=1><img src="/images/image1.jpg"></a></li> <li><a href="yourscript.php?imageID=2><img src="/images/image2.jpg"></a></li> ... </ul> Once an image is clicked, you can use $_GET['imageID'] to see which image was clicked. The ID would be used to query the database to get the point value associated with the clicked image.
  17. Have you tried adding some debugging statements to see where the script is ending? For example: <?php //... if($flag==1) { echo '<div>here (flag==1)</div>'; wp_mail(get_option("admin_email"),trim($_POST[yourname])." sent you a message from StraightForwardLegal.com".get_option("blogname"),stripslashes(trim($_POST['message'])),"From: ".trim($_POST['yourname'])." <".trim($_POST['email']).">\r\nReply-To:".trim($_POST['email'])); echo "Thank you for contacting us!<br> We have received your email. <br> One of our Workers' Compensation Attorneys <br> will be in touch with you as soon as possible"; //header ("location: http://www.straightforwardlegal.com"); exit; } echo '<div>here (flag!=1)</div>'; //... ?> Also, do you have PHP set to show all errors and warnings? If not, enabling them may provide a clue. You can enable all errors and warnings by adding the following to your script: <?php //REPORT ALL PHP ERRORS error_reporting(E_ALL); ini_set('display_errors', 1); ?> Of course, you'll want to remove the above code once everything is fixed.
  18. You could look into using PHP's DOMDocument class to break apart the HTML: http://php.net/manual/en/class.domdocument.php Or if the code is simple enough, you may even be able to locate and replace the time information for "row_12" using a PHP function like strpos(). http://php.net/manual/en/function.strpos.php
  19. As Barand suggested, you could use STR_TO_DATE() to convert the date on the fly.
  20. More information about STR_TO_DATE() can be found here: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_str-to-date You could build a quick script to convert all the dates. Of course, you would need to modify any existing scripts which use those date columns. If that's an issue, you could save the newly formatted dates into new columns. You would be double entering the dates, but this would give you time to modify the your scripts so they use the new columns. Once all of your scripts are using the new date columns, the old ones can be removed.
  21. With today being Aug. 5, you can get the entries from Aug. 5 to Aug. 8 with the following WHERE clause: ... WHERE start_date BETWEEN CURDATE() AND CURDATE() + INTERVAL 3 DAY To get the entries from Aug. 2 to Aug. 5, you can use this instead: ... WHERE start_date BETWEEN CURDATE() - INTERVAL 3 DAY AND CURDATE()
  22. These two statement don't quite line up. With today being Aug. 5, do you want to get all entries from Aug. 2 to Aug. 5? Or do you want the entries from Aug. 5 to Aug. 8?
  23. You could do something like this: window.location.assign("http://store.radioauto.ca/POS/auto.php?Item=" + document.getElementById('upc').value);
  24. Out of curiosity, were you able to get the query working? It looks like you corrected the argument order for mysql_query()...so it's probably fixed.
  25. The code works for me also (with and without the newline character). In case it matters, I even created a test page for both menu_new.php and menu-items.php. Did you try running the HTML code through a validator? http://validator.w3.org/ Perhaps something else is going on...
×
×
  • 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.