Jump to content

Submit Form Not Processing


SalientAnimal

Recommended Posts

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.

Link to post
Share on other sites

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>
Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.