Take out the echo calls, you can’t send information to the browser before the headers.
You can try something like this to still show if an error happens:
if(!$retval) {
echo "Unsuccessfull " . mysql_error();
}
More Related Contents:
- PHP generate file for download then redirect
- Why I have to call ‘exit’ after redirection through header(‘Location..’) in PHP?
- PHP page redirect [duplicate]
- PHP header(Location: …): Force URL change in address bar
- PHP header location-redirect doesn’t work – why? [duplicate]
- How to cause a redirect to occur before php script finishes?
- How can I do a migration in laravel 5.5?
- Best way to store IP in database?
- Which is fastest in PHP- MySQL or MySQLi?
- How to backup MySQL database in PHP?
- PHP Laravel: No connection could be made because the target machine actively refused it
- Auto Increment skipping numbers?
- Create PHP array from MySQL column
- SQL Query with binary data (PHP and MySQL)
- PDO bindParam into one statement?
- UNION syntax in Cakephp
- How do I format numbers to have only two decimal places?
- Convert Time String to Decimal Hours PHP [closed]
- How do i search from serialize field in mysql database?
- How to get last inserted id from table MySQL [duplicate]
- Is mysql_real_escape_string enough to Anti SQL Injection?
- How to make mysqli connect function?
- Group mysql results by category and display them into groups under each category
- How can I list data in sections by an ID, with a while loop in PHP? [closed]
- What is the PDO equivalent of function mysql_real_escape_string?
- Save array in mysql database
- Using PHP to upload file and add the path to MySQL database
- Installing PDO driver on MySQL Linux server
- PHP & mySQL: When exactly to use htmlentities?
- find in set in laravel ? example