Booking return URL

Suggestions and ideas to make Beds24.com better
markkinchin
Site Admin
Posts: 935
Joined: Fri Mar 02, 2012 1:43 pm

The problem is that this file contains HTML markup, it looks like it may have been created with an HTML editor.
The PHP file should contain only the PHP script I posted earlier.
The best way to ensure this is to use a plain text editor. Not a word processor or HTML editor.

The contents of the file are currently

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="en-gb" http-equiv="Content-Language" />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
<meta content="copy-of-poetic 011, default" name="Microsoft Theme" />
<style type="text/css">

* {
	/* Reset browsers default margin, padding and font sizes */
	margin: 0;
	padding: 0;
}

</style>
</head>

<body>

<p><code><?php<br />
<br />
//this if statement tests for French and redirects to a French page<br />
if($_GET["lang"] == "fr") <br />
{ <br />
header("location: http://www.cdh-cavirac.com/reservations/merci.html"); <br />
die;<br />
} <br />
<br />
//this if statement tests for English and redirects to a English page<br />
if($_GET["lang"] == "en") <br />
{ <br />
header("location: http://www.chambresdhote.com/reservations/thankyou.html");
<br />
die;<br />
} <br />
<br />
//if none of the above matched redirect to this page<br />
header("location: http://www.chambresdhote.com/index.html"); <br />
<br />
?><br />
</code></p>

</body>

</html>
quillan
Posts: 57
Joined: Mon Jul 02, 2012 10:32 am

I just tried this by using Notebook (I was using Microsoft Expression 4 before and selected "New php file") and I getbthe same result but different format

//this if statement tests for French and redirects to a French page if($_GET["lang"] == "fr") { header("location: http://www.cdh-cavirac.com/reservations/merci.html"); die; } //this if statement tests for English and redirects to a English page if($_GET["lang"] == "en") { header("location: http://www.chambresdhote.com/reservations/thankyou.html"); die; } //if none of the above matched redirect to this page header("location: http://www.chambresdhote.com/index.html");

This is displayed as before i.e. within the iframe on my reservation page.
markkinchin
Site Admin
Posts: 935
Joined: Fri Mar 02, 2012 1:43 pm

That looks better now, it is just the <?php and ?> bits that are missing at the start and end of the file to tell it it is a script.
Make sure the file starts with <?php and has no no white-space before this.

I would also leave the English redirect the way it was in the example at the end of the file without an IF statement.
The reason is English is the default language and this would then catch any bookings where the lang variable is not explicitly set.
The lang variable will be set if the Language is not English.

So updating the example with your URL's (note your French page is currently returning a 404 error)

Code: Select all

<?php
//this if statement tests for French and redirects to a French page
if($_GET["lang"] == "fr")  { 
header("location: http://www.cdh-cavirac.com/reservations/merci.html"); 
die;
} 

//this statement redirects to a English page if nothing above here matched
header("location: http://www.chambresdhote.com/reservations/thankyou.html"); 
?>
Post Reply