SalientAnimal Posted January 22, 2014 Author Share Posted January 22, 2014 Awesome thanks, it works perfectly... The last issue now is when printing the number of rows inserted is will count the number of characters at the end of the string. i.e. 1 record has been successfully added. Please wait to be redirected.67 This is what is being "echoed" on my success page. and the 67 at the end should not be there. Quote Link to comment Share on other sites More sharing options...
Mace Posted January 22, 2014 Share Posted January 22, 2014 I have no idea where that text is coming from Quote Link to comment Share on other sites More sharing options...
SalientAnimal Posted January 22, 2014 Author Share Posted January 22, 2014 Its wierd, because I looked everywhere and can't figure out why it would count the number of characters in the text that I am echoing. I've never seen that happen. Quote Link to comment Share on other sites More sharing options...
Mace Posted January 22, 2014 Share Posted January 22, 2014 where do you output this text: record has been successfully added. Please wait to be redirected. Maybe it's right after that sentence. Quote Link to comment Share on other sites More sharing options...
SalientAnimal Posted January 27, 2014 Author Share Posted January 27, 2014 where do you output this text: record has been successfully added. Please wait to be redirected. Maybe it's right after that sentence. This is the output file: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <!-- HEADER CONTENT OF PAGE - THIS CONTAINS ALL SCRIPT, CSS, AND META TAG RELATED INFORMATION FOR THE WEBPAGE --> <?php printf("%d Records have been added, please wait to be re-directed.\n", $insert_stmt->affected_rows); include_once 'includes/db_connect.php'; include_once 'includes/functions.php'; include_once 'includes/session_management.php'; ?> <!-- INCLUDE THE HEADER INFORMATION. AN EXTERNAL SHEET HAS BEEN CREATED TO STORE ALL THE FORMATTING --> <head> <title>Altech Autopage - Premier Viewer</title> <script language="javascript"> setTimeout(function () { window.location.href = "http://localhost/walkin_form.php" }, 3000); </script> <meta http-equiv="refresh" content="5;url=http://localhost/walkin_form.php"> </head> </html> Quote Link to comment Share on other sites More sharing options...
Mace Posted January 27, 2014 Share Posted January 27, 2014 My guess is that the number is echo'd in one of the include_once files. Quote Link to comment Share on other sites More sharing options...
SalientAnimal Posted January 27, 2014 Author Share Posted January 27, 2014 This might be a really silly question, but what function will count the number of characters in a string? Cause that's basically what it is doing. It's not a major concern for me right now and I can learn to live with it, but it would be a nice fix. Quote Link to comment Share on other sites More sharing options...
Mace Posted January 27, 2014 Share Posted January 27, 2014 strlen Quote Link to comment Share on other sites More sharing options...
SalientAnimal Posted January 27, 2014 Author Share Posted January 27, 2014 And just to be correct on this, for the function to work, you need to call? The I ask is because I do have one srtlen function, but this is for the token generation I want to implement later. Quote Link to comment Share on other sites More sharing options...
cyberRobot Posted January 27, 2014 Share Posted January 27, 2014 So the mystical number (67) is coming from a call to strlen()? If that's the case and you need the value for later, did you try storing the value in a variable? $stringForToken = strlen($str); Quote Link to comment Share on other sites More sharing options...
SalientAnimal Posted January 27, 2014 Author Share Posted January 27, 2014 This is the only function that I'm using function getToken($length=32){ $token = ""; $codeAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; $codeAlphabet.= "abcdefghijklmnopqrstuvwxyz"; $codeAlphabet.= "0123456789"; for($i=0;$i<$length;$i++){ $token .= $codeAlphabet[crypto_rand_secure(0,strlen($codeAlphabet))]; } return $token; } that has strlen in it. The number 67 is a count of how many characters are in my "Success" message. What I don't understand is why this number is being echoed as nowhere am I calling this function. I have no idea where the mystical number is coming from. Quote Link to comment Share on other sites More sharing options...
Solution Ch0cu3r Posted January 27, 2014 Solution Share Posted January 27, 2014 (edited) You need check the code within your includes. As Mace said that is most probably where it is coming from. To tell which one it could possible be change your your include lines to echo '--'; echo 'db<br>'; include_once 'includes/db_connect.php'; echo 'func<br >'; include_once 'includes/functions.php'; echo 'sess<br >'; include_once 'includes/session_management.php'; echo '--'; Which ever the number 67 appears against that it is file you need to check. Basically look for an any echo/prints's within that file. Edited January 27, 2014 by Ch0cu3r Quote Link to comment Share on other sites More sharing options...
SalientAnimal Posted January 28, 2014 Author Share Posted January 28, 2014 Once again thanks for the help guys. When I did the echo the mystical 67 vanished. I then changed my includes back to the way they were and no more mystical number. I have no idea what fixed it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.