AyKay47
Members-
Posts
3,281 -
Joined
-
Last visited
-
Days Won
1
Everything posted by AyKay47
-
You are mixing javascript and PHP together. This simply will not work since each script is executed at different times. All validation should be done server side.
-
From the manual: 'w+' Open for reading and writing; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it. 'a+' Open for reading and writing; place the file pointer at the end of the file. If the file does not exist, attempt to create it. 'r+' Open for reading and writing; place the file pointer at the beginning of the file. each mode has different settings that control where the pointer is to be placed, whether or not to truncate data etc..
-
A while(true) { } loop with the appropriate break; logic should work fine.
-
Use the comparison operator == instead of the assignment operator. if( $selected = 1 ) will always equate to boolean TRUE.
-
Make sure the "mail function" options are set up correctly in the servers master php.ini file.
-
What code have you wrote so far? Please post it here.
-
Please post the actual relevant code. The above can't be the actual code you are using.
-
At first glance I would say that some JS script is appending a hashed anchor onto the url.
-
you need a call to session_start() in page1.php before you initialize sessions. session_start() must be called before initialization or referencing any sessions in any page that you plan to do so.
-
You have error_reporting set to E_ALL or -1 and display_errors() on? If fopen() is failing it should generate an E_WARNING
-
I have never used this personally before, but I have heard of the PHP/Java Bridge implementation being used to accomplish this. Basically is connects the PHP script engine with a JVM and allows for communication between the two.
-
Comment out the lines that are relevant to sending data to the log? I don't recommend removing them altogether as you may need them in the future, there is a reason the logic was implemented the way it was.
-
PHPMailer is a popular email transport class that supports sendmail, mail(), etc.
-
You are missing a closing single quote after </pre>. Now you are just getting sloppy.
-
$_GET and $_POST values are stored as strings so you cannot perform a strict comparison using a string and an integer, it will always equate to false. You can either use the loose comparison operator as Gristoi has done above, or you can cast the value stored in $_GET['error'] as an integer and use the strict comparison as you have done. As a side note, always check that $_GET and $_POST values isset before assigning their value to a variable.
-
Use stripos which is the case-insensitive version of strpos(), will save you some writing. Also, in the elseif block conditional statement, place parens around each && condition for correct order of operations: (this && that) || (this && that) I don't quite understand you logic, I believe you want the post_cbox() function to execute but do not want any data to be written to a file?
-
I assume you have a mail server set up and the correct SMTP/sendmail settings?
-
Can someone tell me what the error is in this PHP '$_GET if else' code
AyKay47 replied to james909's topic in PHP Coding Help
What is the exact error that is being displayed? -
Pseudo code: if(isset($_POST['index'])) { $i = $_POST['index']; } or the way I prefer: $i = (isset($_POST['index'])) ? $_POST['index'] : null;
-
Have you double checked the permissions of the file?
-
Not to be crude, but there are so many things wrong with this code that I cannot take the time at the moment to look through it all line by line. There is only one method that modifies the _errors property, i suggest looking there first and implementing proper error checking logic into your code during development.
-
This is starting to make little sense to me, you say that the handling PHP file cannot be found, yet the parser is spitting out errors which means that the script is being executed.
-
I thought the initial problem was that the called php file was not found? The foreach error is being triggered because you are passing the construct an object instead of an array. By default, if json_decode() is passed an object, it returns an object unless the second "assoc" parameter is set to TRUE.
-
Since you are using a relative file path to demogstore.php, make sure that demogstore.php and the html file that is sending the form data to it are in the same directory.