-
Posts
3,145 -
Joined
-
Last visited
-
Days Won
37
Everything posted by cyberRobot
-
Sorry, part of the message was cut off. The rest is below. Side note: mysql_real_escape_string() requires a database connection to be established before it's used. More information can be found here: http://php.net/manual/en/function.mysql-real-escape-string.php
-
This may seem like a silly question, but did you post the same code as what you're actually using? Perhaps you could re-paste the code you are currently working with. Of course, you'll want to hide the database password like before. Also, do you have it so all errors and warnings are being shown? <?php //REPORT ALL PHP ERRORS error_reporting(E_ALL); ini_set('display_errors', 1); ?>
-
It seems like a quote wasn't closed after Please check below for Error Details It seems fine in the code posted. Did you remove any code from insert.php before posting it here?
-
HTML pages can be configured to run PHP.
-
Did you run the code? That's an easy way to find out.
-
form validation forename with capital at start
cyberRobot replied to daniel0816's topic in PHP Coding Help
Note that formatting names like this will cause names like "McKenzie" to display incorrectly. -
Reload image button and every 60 seconds.
cyberRobot replied to Dragosvr92's topic in Javascript Help
Yep, try out nogray's code. -
If all you want to do is display a message and prevent further code from being executed on Sundays, exit() is what you're looking for. If you're looking to accomplish something else, let us know.
-
Reload image button and every 60 seconds.
cyberRobot replied to Dragosvr92's topic in Javascript Help
What are you looking to accomplish? Is the same image always being displayed...or are you looking to rotate through a series of different images? -
Perhaps exit() is what you're looking for: http://php.net/manual/en/function.exit.php
-
As long as the date() function is part of the third argument for mail(), it should appear in the message. The best way to determine if it works is to give it a try. Note: you'll probably want to send any tests to yourself instead of the people who typically receive the message. That way you can send out multiple messages without bothering other people. For future reference, I would recommend using variables to store the arguments for mail(). The code becomes much easier to follow. Examples 2 and 4 on the following page will show you what I mean: http://php.net/manual/en/function.mail.php
-
In addition to what PravinS said, the date() function needs to be outside of the quotes. <?php ..."Awards Re-Order", date('r') . "|{$_POST['yearaward']}|"... ?>
-
Have you looked into fwrite()? http://us3.php.net/manual/en/function.fwrite.php You could also look at some of the other file functions found here: http://us3.php.net/manual/en/ref.filesystem.php If you need help saving things to a text file, there may be something for you here: https://www.google.com/search?q=save+php+output+to+file
-
It looks like the user_data() function expects a user ID. You're currently passing a string: user_data('user_type')
-
Time difference between login time & next date
cyberRobot replied to ajoo's topic in PHP Coding Help
If you decide to go with a JavaScript solution, just be aware that the user could modify their system's clock to cheat the system. -
As you're looping through the MySQL data, you could build a multidimensional associative array. More information could be found here: https://www.google.com/search?q=multidimensional+associative+array+php You could then use a foreach loop to display the HTML table.
-
PHP Retrieving cookies from differents pages
cyberRobot replied to Codenames's topic in PHP Coding Help
Sorry, I'm not really sure what you're asking. Are you stuck somewhere? If you're looking to create/use cookies, perhaps the following will help: http://php.net/manual/en/features.cookies.php Note that you could also use PHP sessions: http://us1.php.net/manual/en/book.session.php -
Are the datalists for Gene 1 and Gene 2 supposed to be the same? If so, you could use a single query to grab the list, store it in a variable, and use the variable to populate the datalists. Also, you probably don't need to create the $Column_2 variable in the while loop. You could just use the $rows variable: <?php echo "<option value={$rows['COL 2']}>{$rows['COL 2']}</option> <br>"; ?>
-
PHP MySqli does not fetch last row from the table.
cyberRobot replied to angel1987's topic in PHP Coding Help
Have you looked closely at the values for the LIMIT clause? LIMIT $startpoint, $limit I suspect it might be an offset issue. The following quote was pulled from http://dev.mysql.com/doc/refman/5.0/en/select.html: -
It sounds like you're looking for length property: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length If you're unsure how to use length, there are many resources here: https://www.google.com/search?q=javascript+character+count+textarea For future reference, JavaScript questions should be posted in the JavaScript forum: http://forums.phpfreaks.com/forum/18-jvscript-help/
-
The right place to declare class properties
cyberRobot replied to Drongo_III's topic in PHP Coding Help
From the manual (http://php.net/manual/en/language.oop5.properties.php): -
Have you checked that the variables contain expected values? For example, what do you get for the following: <?php $array=$_POST['tel']; //numbers fetched from contact of mobile print '<pre>' . print_r($array, true) . '</pre>'; $jstring = (array)json_decode($array,JSON_FORCE_OBJECT); print '<pre>' . print_r($jstring, true) . '</pre>'; ?>
- 3 replies
-
- php
- exploded array
-
(and 1 more)
Tagged with:
-
Are you using OpenCart? If so, perhaps this will help: http://forum.opencart.com/viewtopic.php?t=45398
-
Have you tried passing a GET variable with the header redirection? The addproduct.php page could then display the success message if the GET variable is detected. <?php header("Location: addproduct.php?sucess=1"); ?>
-
Sorry, the portion after the code was cut off. Here is the rest: Of course, you'll want to perform some extra tests to make sure the POST variable actually contains a URL. You could utilize the built-in validation filter: http://php.net/manual/en/filter.filters.validate.php