English 中文(简体)
php 户主所在地
原标题:php header location attribute not working
  • 时间:2010-06-17 14:11:15
  •  标签:
  • php
  • header

尽管我能够在网上找到了所有建议,但我还是有一个更棘手的地点问题。 邮递人寄送电子邮件,但我收到一张头盔已经发送了与第29条线有关的错误,该行名号码为“Location:$thanksURL”;},没有改用确认网页。 如果我用印刷确认性信息的指示取代标题位置代码,那么它就能够发挥作用,因此,必须就服务器的头号位代码做一些事情。

该守则是:

<?php
ob_start(); 
$to = "msheath@btinternet.com" ; 
$from = $_REQUEST[ email ] ; 
$name = $_REQUEST[ name ] ; 
$headers = "From: $from"; 
$subject = "Request for Library Document"; 
$thanksURL = "http://www.postalhistory.org.uk/newsite/php/thankyou.php"; //confirmation page
$fields = array(); 
$fields{"name"} = "Name"; 
$fields{"address"} = "Address"; 
$fields{"email"} = "Email"; 
$fields{"tel"} = "Telephone No"; 
$fields{"author1"} = "First Author"; 
$fields{"title1"} = "First Title"; 
$fields{"author2"} = "Second Author"; 
$fields{"title2"} = "Second Title"; 
$body = "I would like to borrow the undermentioned book(s) from the PHS Library:

"; foreach($fields as $a => $b){    $body .= sprintf("%20s: %s
",$b,$_REQUEST[$a]); } 
$headers2 = "From: The Librarian, Postal History Society"; 
$subject2 = "Thank you for contacting the Postal History Society"; 
$autoreply = "Thank you for your request. Somebody will get back to you as soon as possible, usually within 48 hours.";
if($from ==   ) {print "You have not entered an email, please go back and try again";} 
else { 
if($name ==   ) {print "You have not entered a name, please go back and try again";} 
else { 
$send = mail($to, $subject, $body, $headers); 
$send2 = mail($from, $subject2, $autoreply, $headers2); 
if($send) 
{header("Location: $thanksURL");} 
else 
{print "We encountered an error sending your mail, please notify webmaster@YourCompany.com"; } 
}
}
ob_end_flush()
?>

Go to http://www.postalhistory.org.uk/newsite/php/library.php • 试图回避。

Can anyone suggest what is wrong?

迈克

问题回答

头脑已经寄出,这意味着你已经向浏览器寄出一些东西。 这可能是一个白人空间。 也可以是,你的文件在UTF-8与BOM编码,这意味着你把BOM送至浏览器。

警告:Cannot 更改标题信息——已经由(产出始于/home/users/uks52804/html/postalhistory.org.uk/newsite/php/contact.php:1)寄来的头目,载于第29行文/家/用户/uks52804/html/postalhistory.org.uk/newsite/php/contact.php。

这意味着,在你发出“开始”呼吁之前,你已经取得了产出。 斜线——起步应当是包括该代码在内的首页指示。

我面临同样的问题,同时认为,在确定主人之前,我是重复的。 我删除了重复声明,并清除了一些消除问题的白色空间。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签