Jump to content

Warning: Header may not contain more than a single header, new line detected inea


james212121

Recommended Posts

Getting this error: Warning: Header may not contain more than a single header, new line detected in

While using POST and GET between variabales:

 

<?php
    $name = $_POST["Name"];
    $email = $_POST["Email"];
    $title = $_POST["Title"];
    $rating = $_POST["Rating"];
    $review = $_POST["Review"];    
    $broker = $_GET["Broker"];
    header("Location: /thankyou-review.php?Name=$name&Email=$email&Title=$title&Rating=$rating&Review=$review&Broker=$broker");
?>

 

Please note the $review parameter is a pargaph that contain text and breaklines.

Please advise.

This is the insert MYSQL query:

 

$insertreview = "INSERT INTO userreview (Name, Email, Title, Rating, Review, Status, Broker) VALUES ('$name','$email','$title','$rating','$review','0','$broker')";
 

Got this MYSQL Error:

 

Query:  INSERT INTO userreview (Name, Email, Title, Rating, Review, Status, Broker) VALUES ('Raul','[email protected]','It's OK!','5','Tra...

Error Code: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's OK!','5','Trading there for 2 months, I'm Spanish speaker so I have my dedicat' at line 1

Execution Time : 0 sec
Transfer Time  : 0 sec
Total Time     : 0.040 sec

 

I think it happens becuase of the '

No, I'm not. Try to search it on Google look complicated.

How would you use it in this code:

 

$insertreview = "INSERT INTO userreview (Name, Email, Title, Rating, Review, Status, Broker) VALUES ('$name','$email','$title','$rating','$review','0','$broker')";

I still don't know what database functions you're using (look at my sig), but where ever you define the vars you need:

$name = mysqli_real_escape_string($link, $_GET['name']);

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.