Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. The information shown in the phpinfo() output is ALL the information that your web server/php receives with each request. Your web server is apparently behind a proxy server, which is setting the $_SERVER["HTTP_X_FORWARDED_FOR"] header. I expected this to also be set for the https request. I would speak to the server administrator and see what he/they can do about getting the $_SERVER["HTTP_X_FORWARDED_FOR"] header passed through with the https request.
  2. Use a phpinfo(); statement in a php script and browse to it through https and examine the PHP Variable section at the end of the output and see if you are receiving the actual IP address in one of the $_SERVER variables.
  3. Except that you are using prepared statements and you are not using mysqli->affected_rows and any definition found in the manual concerning mysqli->affected_rows does not apply to prepared statements. You are using $stmt->affected_rows and it does not do what you think for a SELECT query.
  4. mysqli_stmt->affected_rows does this - For a SELECT query you would want to use $stmt->num_rows
  5. After you get the corresponding information from the two files into two arrays - http://us.php.net/manual/en/function.array-diff.php
  6. What's wrong with the following word in your query: PRIMATY
  7. Is it your form processing code that is redirecting back to the form or is it the form itself that is not submitting to the URL of the form processing code? What checking do you have in your form or your form processing code that would tell you what is happening?
  8. Blank pages are usually due to fatal parse or fatal runtime errors. In your case - You should be learning php, developing php code, and debugging php code on a system with error_reporting set to E_ALL and display_errors set to ON in your master php.ini so that php will help you. (Confirm the actual settings using a phpinfo() statement in case the php.ini that you are changing is not the one that php is using.) You will save a ton of time.
  9. This is reaching a bit, but if the php code in mysql.inc.php is not being seen as php code but the include_once() is actually working, then the unparsed php 'code' would show up in the "view source" of the page in your browser. Also, add an echo statement of something in mysql.inc.php so that you get confirmation that the code in it is being executed.
  10. It would take seeing your code in order to be able to tell you why it produced that result. Best guess is that the actual code that was executed is not the code you changed.
  11. There is a missing 'not' in the above post "... looking at is 'not' the one that ..."
  12. Where in the include_path is the '.' ? If it is not the first entry and you have more than one mysql.inc.php on the include_path, then the mysql.inc.php that you are looking at is the one that is actually being included.
  13. Example #3 at this link - http://us.php.net/manual/en/features.file-upload.post-method.php shows how you can put multiple type="file" fields in your form and then loop through the uploaded files in the form processing code. If you want to add the upload fields dynamically, see this link - http://www.phpfreaks.com/forums/index.php/topic,278558.0.html
  14. While it does appear that you have error_reporting set to show all php errors (a problem with the include_once sould show up as a Warning message), add the following two lines of code immediately after the first opening <?php tag in the main file - ini_set("display_errors", "1"); error_reporting(E_ALL); Try the following syntax for the include (You are directly using the file name in this? You are not actually using a URL?) - include 'mysql.inc.php'; The global keyword has absolutely no meaning unless it is inside of a function definition (and even there it should not be used.) Remove your use of it in the main file. Do you in fact have more than one mysql.inc.php present on the server in any of the paths listed in the include_path? Perhaps one with only the open_db_connection() and close_db_connection() functions and NOT the in-line mysql_connect()/mysql_select_db() code? What does a phpinfo() statement show? (i.e. make sure of what the setting is at runtime in case the php.ini that you are looking at is not the same one that php is using.)
  15. Your actual code inside of the while() loop is probably reusing and overwriting the $result variable.
  16. And in fact, using php, will make any changes to the form or the form processing code simpler because you will only need to make the change once instead of 14 times - The form: <?php $days = array(); // array of day names $days[] = 'SUNDAY'; $days[] = 'MONDAY'; $days[] = 'TUESDAY'; $days[] = 'WEDNESDAY'; $days[] = 'THURSDAY'; $days[] = 'FRIDAY'; $days[] = 'SATURDAY'; $num_weeks = 2; // your code appears to handle two weeks $content = "<form method='post' form action='paytest.php'> <table width='541' border='1'> <tr> <th width='115'>Day</th> <th width='73'>Date</th> <th width='73'>Flat Rates</th> <th width='78'>Overnights</th> <th width='77'>Perdiem</th> <th width='85'>N #</th> </tr>"; $index = 1; // start various index values at 1 // loop for the correct number of weeks for($x=1;$x<=$num_weeks;$x++){ // iterate over each day in the week foreach($days as $day){ $content .= "<tr> <td>$day</td> <td><input type='text' size='10' maxlength='40' textarea name='date[$index]'></td> <td><input type='text' size='10' maxlength='40' textarea name='flatrate[$index]'></td> <td><input type='text' size='10' maxlength='40' textarea name='overnights[$index]'></td> <td><input type='text' size='10' maxlength='40' textarea name='perdiem[$index]'></td> <td><input type='text' size='10' maxlength='40' textarea name='tailnumber[$index]'></td> </tr>"; $index++; } } $content .= "</table> <input type='submit' value='Send'> <br /> </form>"; echo $content; ?> The form processing code: <?php $text = ''; $count = count($_POST['date']); // loop through each (14) sets of data for($x=1;$x<=$count;$x++){ $text.="date:{$_POST["date"][$x]}\n"; $text.="flat rate:{$_POST["flatrate"][$x]}\n"; $text.="over nights:{$_POST["overnights"][$x]}\n"; $text.="perdiem:{$_POST["perdiem"][$x]}\n"; $text.="tail number:{$_POST["tailnumber"][$x]}\n"; } // echo nl2br($text); // testing testing... $to = "[email protected]" ; $subject = "paysheet" ; $header = "from: Jason Smith" ; $sent = mail($to, $subject, $text, $header) ; if($sent){ print "Your pay sheet was sent successfully"; } else { print "We encountered an error sending your mail"; } ?>
  17. Slightly off topic, but you do know that if you used php to produce the form and used arrays for the fields, that both the form and the form processing code could be reduced to a small number of lines.
  18. And the whole mysql.inc.php file. xxxxx out any sensitive information. What are the two functions doing in the mysql.inc.php code you posted? The first one should work, except that you cannot use the $connection variable outside of that function because it is not being returned by the function, but the close_db_connection function, as written, cannot work. We only see the information you provide in your post. To get help with what your code is doing, we need to see your code. There are probably 5,000,000+ php based web sites that are including a database connection file that works. That means something you are doing on your server is not working. Interestingly, the first time I tried your posted code, it did not attempt to execute the mysql_connect() statement in the include file and it was only after I went into the files and altered them by adding echo statements that it did execute the code as expected. I suspect that the editor you are using is not producing straight ASCII source code. Also, what php version, because php.net has had a lot of bugs in the _once versions of include/require.
  19. No on can tell from a blank page what is causing the problem. You would need to post the actual source code of the page if you expect someone else to help find what it is doing.
  20. You are going to need to post your whole actual code from the start of the file up through the line with the error if you want someone else to determine why it is not working. Based on the out of context code posted so far, all anyone can determine is that -
  21. You don't have a valid mysql connection at the time your mysql_query() is being executed. You are probably using short open tags <? in your mysql.inc.php file and the php code in it is not being seen as php code. Always use full php tags to avoid wasting your time when you move to a different server.
  22. Add the following two lines of code immediately after your first opening <?php tag in the logout code - ini_set("display_errors", "1"); error_reporting(E_ALL); Why is your logout code testing $_SESSION['first_name']? Your log in code is not setting that, so it is highly likely that your log out code is not doing what you think. Also, why is your log out code producing and assigning a new password every time someone logs out?
  23. If this problem occurs with every user_id that is in your 'activemembers.txt' file, then you have a systematic problem with how you are producing or storing information in that file (and please be advised if the 'activemembers.txt' file is in a 'public' web accessible folder, that anyone who guesses the file name can browse to it and get all your member information.) If you cannot determine what character is present in the data that is causing the problem, make a test version of 'activemembers.txt' that only has one entry in it with dummy data. If the test file produces the symptom, attach the file to a post so that someone can examine what is actually in it. Best guess is that you are using a Word Processor to edit the file (or you copied/pasted from a Word Processor) and the underlying formatting characters that the Word Processor uses in the file is what is causing the problem.
  24. Find out what exactly is in $user_id - $arr = str_split($user_id); foreach($arr as $key => $value){ $val = ord($value); echo "Value of character at pos: $key, is $val<br />"; }
  25. http://dev.mysql.com/doc/refman/5.0/en/insert-select.html
×
×
  • 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.