pro_php thread: Re: [PHP] Passing string variable to HTML TITLE tag fails withinNetscape but works well within IE.
Thank you, I appreciate the help.I think the following code and information will help to illustrate the
original problem:
Page A:
<html>
file:// basically open proddetails and initialize varibles a,c, and E
<?php if ($userstatus == ""): ?>
<a href="proddetails.php?a=b&c=d&E=Product Details about a product">CLICK THIS</a>
<?php endif; ?>
+++++++
Page B (name: proddetails.php)
<?php
file://this checks to see if variable E is set, if so $title gets the contents of E
if (isset($HTTP_GET_VARS["E"])) {
$title = $HTTP_GET_VARS["E"];
}
?>
<html>
<title> <?php echo $title ?> </title> <!-- this title tag ultimately obtains the contents of variable E from
page A -->
</html>
OUTPUT:
The title tag within Internet Explorer reads: Product Details about <a product>
The problem is:
Netscape on the other hand gives the following error message.
Does anyone have a proven solution to this problem?
THIS E-MAIL MESSAGE AND ALL ATTACHMENTS TRANSMITTED HEREWITH ARE TRADE
SECRET AND/OR CONFIDENTIAL INFORMATION INTENDED ONLY FOR THE VIEWING AND
USE OF ADDRESSEE. IF THE READER OF THIS MESSAGE IS NOT THE INTENDED
RECIPIENT, YOU ARE HEREBY NOTIFIED THAT ANY REVIEW, USE, COMMUNICATION,
DISSEMINATION, DISTRIBUTION OR COPYING OF THIS COMMUNICATION IS PROHIBITED.
IF YOU HAVE RECEIVED THIS COMMUNICATION IN ERROR, PLEASE NOTIFY THE SENDER
IMMEDIATELY BY TELEPHONE OR ELECTRONIC MAIL, AND DELETE THIS MESSAGE AND
ALL COPIES AND BACKUPS THEREOF. THANK YOU FOR YOUR COOPERATION.
-----Original Message-----
From: Chris Shiflett <chris@s...>
To: dwalker <dwalker@h...>
Cc: php-general@l... <php-general@l...>
Date: Tuesday, October 15, 2002 11:46 PM
Subject: Re: [PHP] Passing string variable to HTML TITLE tag fails withinNetscape but works well within IE.
>You should give more information about your original problem rather than
>inquire about any workaround.
>
>I don't understand how "passing string variable to html title tag fails
>within Netscape but work well within IE".
>
>dwalker wrote:
>
>> Passing string variable to HTML TITLE tag fails within Netscape but work
>> well within IE.
>>
>> I have a single page consisting of inventory items to be sold. When an
>> item
>> is selected, it passes the product name to a DETAIL page as part of the
>> TITLE tag for the DETAIL page. My problem is: Netscape does not like the
>> SPACES between the text and refuses to display the DETAIL page.
>>
>> Initially, I thought there might be some way to parse the string and
>> add the
>> ascii code for SPACE, but I wasn't sure if I was on the right track. Does
>> anyone have a proven solution to this problem?
>>
>> I thought the pseudo code might look something like this:
>> <?php
>> function parse_and_change(&grab_string){
>> $string_holder=$grab_string;
>> while stepping through the characters in this $string_holder {
>> if character = " " (or some other representation)
>> replace it with something that doesn't
>> scare netscape or title tag
>> }
>> return $string_holder;
>> }
>> ?>
>>
>> <?php
>> if (isset($HTTP_GET_VARS["itemname"])) {
>> $title = (parse_and_change($HTTP_GET_VARS["itemname"] ));
>> }else{
>> $title="Generic Product Title";
>> }
>> ?>
>>
>> <html>
>> <title><?php echo $title ?> </title>
>> </html>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>