Jump to content

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


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','raul@gmail.com','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 '

Are you not using mysqli_real_escape_string() or similar on vars before inserting?

 

You need to find some good and recent tutorials.

Edited by AbraCadaver

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']);
Edited by AbraCadaver
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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