-
Posts
3,145 -
Joined
-
Last visited
-
Days Won
37
Everything posted by cyberRobot
-
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'];
-
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
-
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.
-
Trying to get a simple PHP SQL search to work
cyberRobot replied to Disead's topic in PHP Coding Help
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> -
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/
-
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.
-
Warning: Cannot modify header information -
cyberRobot replied to jackcoder's topic in PHP Coding Help
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 -
If you want to use JavaScript, here's a quick example: http://javascript.about.com/library/bldydrop1.htm
-
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.
-
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
-
Help with page number. Where am I going wrong?
cyberRobot replied to mrdobalina's topic in PHP Coding Help
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/ -
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.
-
Registration through Website with PHP and Mysql
cyberRobot replied to Apex_Wilson's topic in PHP Coding Help
Perhaps I'm missing something, but you didn't provide any details on the potential solution. -
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
-
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?
-
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.
-
Redirecting My URL after submitting my contact form
cyberRobot replied to Megan's topic in PHP Coding Help
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. -
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
-
Date, between date column and date column -3 days
cyberRobot replied to lasha's topic in PHP Coding Help
As Barand suggested, you could use STR_TO_DATE() to convert the date on the fly. -
Date, between date column and date column -3 days
cyberRobot replied to lasha's topic in PHP Coding Help
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. -
Date, between date column and date column -3 days
cyberRobot replied to lasha's topic in PHP Coding Help
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() -
Date, between date column and date column -3 days
cyberRobot replied to lasha's topic in PHP Coding Help
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? -
You could do something like this: window.location.assign("http://store.radioauto.ca/POS/auto.php?Item=" + document.getElementById('upc').value);
-
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.
-
Why is the frame not displaying when using "\n" tag
cyberRobot replied to eldan88's topic in PHP Coding Help
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...