RE: [PHP] Echo # problem

2003-02-12 Thread Ford, Mike [LSS]
> -Original Message-
> From: Chris Hayes [mailto:[EMAIL PROTECTED]]
> Sent: 12 February 2003 13:02
> 
> At 13:46 12-2-03, you wrote:
> >The code I am trying to get working is shown below however, 
> as the # is
> >interpreted as a comment the header function is only redirecting to
> >
> >./itemadmin.php3?submittedby=$submittedby&cat=$cat
> >
> >$head = "./itemadmin.php3?submittedby=$submittedby&cat=$cat#$edit";
> >header ("Location:$head");
> 
> I think  the problem may be that the #zzz should be before 
> the ?x=1&y=2

No that's wrong -- the #anchor part must always be the last thing in the URL.

A couple of things occur:
 - make sure $edit has something valid in it (by temporarily echo-ing it just before 
the header call, if necessary);
 - rewrite your Location: header to be technically valid: (a) there should be a space 
between Location: and the URL, and (b) it really should contain an absolute URL, not a 
relative one, so: header("Location: 
http://www.example.com/path/to/itemadmin.php3?etc,etc";).

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Echo # problem

2003-02-12 Thread Chris Hayes
At 13:46 12-2-03, you wrote:

The code I am trying to get working is shown below however, as the # is
interpreted as a comment the header function is only redirecting to

./itemadmin.php3?submittedby=$submittedby&cat=$cat

$head = "./itemadmin.php3?submittedby=$submittedby&cat=$cat#$edit";
header ("Location:$head");


I think  the problem may be that the #zzz should be before the ?x=1&y=2
If i am right it means that # was not considered a comment by PHP but that 
the browser cannot find it.Does the url in the browser show with the #edit 
part?

In that case try

$head = "./itemadmin.php3#$edit?submittedby=$submittedby&cat=$cat";

or maybe

$head = './itemadmin.php3#'.$edit.'?submittedby='.$submittedby.'&cat='.$cat;

PS   ./ ?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Echo # problem

2003-02-12 Thread Petre Agenbag
Two ways:
a) echo "blabla # $blabla";

or 
b) echo 'blabla # '.$blabla;

The # character must just be inside the echo's quotes.



On Wed, 2003-02-12 at 13:36, Paul McQ wrote:
> I am writing an application in which I need to redirect to an url using the
> Header function.  This redirection must include the # character so that the
> user is taken to the relevant part of the following page.
> 
> PHP sees the # as a comment no matter what I do and therefore the
> redirection doesn't work as I would like.  Does anyone know how you can use
> PHP to echo the # character?
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Echo # problem

2003-02-12 Thread Paul McQ
I am writing an application in which I need to redirect to an url using the
Header function.  This redirection must include the # character so that the
user is taken to the relevant part of the following page.

PHP sees the # as a comment no matter what I do and therefore the
redirection doesn't work as I would like.  Does anyone know how you can use
PHP to echo the # character?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] echo "" problem NEW

2002-01-09 Thread Paul Burney

on 1/9/02 8:17 AM, Henning Sprang at [EMAIL PROTECTED] appended the
following bits to my mbox:

> just another one - but i am too out of practice with html standarts to
> know if this is compliant ( a browser showing a result doesn't
> neccessary mean it's standarts compliant!)

FYI:

By default, SGML requires that all attribute values be delimited using
either double quotation marks (ASCII decimal 34) or single quotation marks
(ASCII decimal 39). Single quote marks can be included within the attribute
value when the value is delimited by double quote marks, and vice versa.
Authors may also use numeric character references to represent double quotes
(") and single quotes ('). For double quotes authors can also use
the character entity reference ".

From:

http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.2

HTH.

Paul Burney





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] echo "" problem NEW

2002-01-09 Thread Bas van Rooijen


Hello,

In addition to Henning Sprang's fine solutions, you can also do the following (given 
you use PHP 4);



$xmp_text


EOF;
   
?>

Note that the {} around your variables are optional, they will not be included in the 
output but can be used to avoid confusion.

greets,

bvr.


On Wed, 9 Jan 2002 15:00:55 +0700, universal2001 wrote:

>Hi again!
>
>Thanks for the reply!
>
>I still have another question:
>
>I want to create a recycleable code by printing a set of html code which I
>copied and paste from my html edittor.
>
>however because there are lots of quotation marks on the html code it result
>an error page.





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] echo "" problem NEW

2002-01-09 Thread Nicolas Costes


Yes, you're right !!!

some browsers like IE will accept even  , , , and some like Opera will only understand :
 ;-))

Le Mercredi 9 Janvier 2002 14:17, Henning Sprang a écrit :
> Nicolas Costes wrote:

-- 
 ( * >Nicolas Costes,
 //\\  IUT de La Roche / Yon
( \/ ) [EMAIL PROTECTED]
 < <  http://luxregina.free.fr

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] echo "" problem NEW

2002-01-09 Thread Henning Sprang

Nicolas Costes wrote:

> Hellorghh !!!
> You'd better do like this :
> 
> echo "

> 

just another one - but i am too out of practice with html standarts to 
know if this is compliant ( a browser showing a result doesn't 
neccessary mean it's standarts compliant!)

henning





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] echo "" problem NEW

2002-01-09 Thread Nicolas Costes

Hellorghh !!!
You'd better do like this :

echo "


Le Mercredi 9 Janvier 2002 13:05, Henning Sprang a écrit :
> Hy,
>
> universal2001 wrote:
> > Hi again!
> >
> > Thanks for the reply!
> >
> > I still have another question:
> >
> >
> > so I tired to use (echo) like this:
> >
> > echo "
> >   
> >  > border="0">
> >   
> >   
> >  > src="img_heading/index_r1_c1.gif" width="639" height="5" border="0">
> >  > border="0">
> >   
> >   
> >  > src="img_heading/index_r2_c1.gif" width="25" height="43" border="0">
> > ";
> > but it DOES NOT WORK.
> > How do I get way with all of the quotation marks
>
> 1) you can escape each double quote with a backslash,
> the first line of your thing woulkd then look like
>
> echo " width=\"639\">
>
> and so on
>
> 2) if you don't want this by any reason, you can use single quotes to
> mark the text you want to print out like in
>
> echo '';
>
> the difference is that with single quotes you will _not_ be able to use
> variable replacement in between the quotes, something like
>
>  $myvar=100;
> echo "";
> ?>
>
> will output
>
> 
>
>
> while this:
>
>  $myvar=100;
> echo '';
> ?>
>
> will output exactly
>
> 
>
>
> hth,
> henning

-- 
 ( * >Nicolas Costes,
 //\\  IUT de La Roche / Yon
( \/ ) [EMAIL PROTECTED]
 < <  http://luxregina.free.fr

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] echo "" problem NEW

2002-01-09 Thread Henning Sprang

Hy,



universal2001 wrote:

> Hi again!
> 
> Thanks for the reply!
> 
> I still have another question:

> 
> so I tired to use (echo) like this:
> 
> echo "
>   
>  border="0">
>   
>   
>  src="img_heading/index_r1_c1.gif" width="639" height="5" border="0">
>  border="0">
>   
>   
>  src="img_heading/index_r2_c1.gif" width="25" height="43" border="0">
> ";
> but it DOES NOT WORK.
> How do I get way with all of the quotation marks




1) you can escape each double quote with a backslash,
the first line of your thing woulkd then look like

echo "

and so on

2) if you don't want this by any reason, you can use single quotes to 
mark the text you want to print out like in

echo '';

the difference is that with single quotes you will _not_ be able to use 
variable replacement in between the quotes, something like

";
?>

will output




while this:

';
?>

will output exactly




hth,
henning



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] echo "" problem NEW

2002-01-08 Thread Steve Maroney



I simply use single quotes for html and double quotes for PHP.

echo "";

works for me.


Steve


On Tue, 8 Jan 2002, Steven Cayford wrote:

> On 2002.01.09 02:00:55 -0600 universal2001 wrote:
>
> > so I tired to use (echo) like this:
> >
> > echo "
> >   
> >  > border="0">
> >   
> >   
> >  > src="img_heading/index_r1_c1.gif" width="639" height="5" border="0">
> >  > border="0">
> >   
> >   
> >  > src="img_heading/index_r2_c1.gif" width="25" height="43" border="0">
>
> Try to think like a computer program. It sees the command:
> echo "";
>
> Or you could drop out of php mode entirely to do your html like this:
>
>  ...php stuff here ...
> ?>
>
> 
>
>  ...more php stuff...
> ?>
>
> One of these methods should get you going.
>
> -Steve
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>








Thank you,
Steve Maroney





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] echo "" problem NEW

2002-01-08 Thread CC Zona

In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Steven Cayford) wrote:

> You can tell php to treat quotes as text by escaping 
> them: putting a \ in front of them like this:
> 
> echo "";
> 
> Or you could drop out of php mode entirely to do your html like this:
> 
>  ...php stuff here ...
> ?>
> 
> 
> 
>  ...more php stuff...
> ?>
> 
> One of these methods should get you going.

There's also the heredoc option (variable interpolation, no need to escape 
of quotes, no jumping back and forth between PHP mode and HTML mode) 
:

echo<<
   
   $mycontent
   



.$classname { margin: 10px; background-color: black; color: white; }


 Blah blah...
EOF;

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




FW: [PHP] echo "" problem NEW

2002-01-08 Thread Necro


Use the \ escape character.
echo "\n";
."\n";
."\n";
."\n";
."\n"

Use the . to add to echo to make the code easier to manage.
Use \n to take a newline in html so that the source code is easy to read
once you view it from a browser.
Just make sure at the end of your last addition line with . that you end the
line with a ;

E.g your last line would be
."\n";


That should help you.

Andrew Duck




-Original Message-
From: universal2001 [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 9 January 2002 7:01 PM
To: [EMAIL PROTECTED]
Subject: [PHP] echo "" problem NEW
Importance: High


Hi again!

Thanks for the reply!

I still have another question:

I want to create a recycleable code by printing a set of html code which I
copied and paste from my html edittor.

however because there are lots of quotation marks on the html code it result
an error page.

here is part of the html code:

  

  
  


  
  

 ...etc

so I tired to use (echo) like this:

echo "
  

  
  


  
  

";
but it DOES NOT WORK.
How do I get way with all of the quotation marks

thank for all the help.

Dani






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] echo "" problem NEW

2002-01-08 Thread Steven Cayford

On 2002.01.09 02:00:55 -0600 universal2001 wrote:

> so I tired to use (echo) like this:
> 
> echo "
>   
>  border="0">
>   
>   
>  src="img_heading/index_r1_c1.gif" width="639" height="5" border="0">
>  border="0">
>   
>   
>  src="img_heading/index_r2_c1.gif" width="25" height="43" border="0">

Try to think like a computer program. It sees the command:
echo "";

Or you could drop out of php mode entirely to do your html like this:







One of these methods should get you going.

-Steve

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] echo "" problem NEW

2002-01-08 Thread universal2001

Hi again!

Thanks for the reply!

I still have another question:

I want to create a recycleable code by printing a set of html code which I
copied and paste from my html edittor.

however because there are lots of quotation marks on the html code it result
an error page.

here is part of the html code:

  

  
  


  
  

 ...etc

so I tired to use (echo) like this:

echo "
  

  
  


  
  

";
but it DOES NOT WORK.
How do I get way with all of the quotation marks

thank for all the help.

Dani