corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » php question - need more help :( » Post Reply

Post Reply
Who Can Post? All users can post new topics and all users can reply.
Icon:
Formatting Mode:
Normal
Advanced
Help

Insert Bold text Insert Italicized text Insert Underlined text Insert Centered text Insert a Hyperlink Insert Email Hyperlink Insert an Image Insert Code Formatted text Insert Quoted text
Message:
HTML is Off
Smilies are On
BB Code is On
[img] Code is On
Post Options: Disable smileys?
Turn BBCode off?
Receive email notification of new replies?

Dom

posted on 22nd Jan 05 at 00:02

right have a string with html code in it (ie :$string = "<font face=\"$strFace"\>", have also tried "face="" . $strFace . "\ etc) and basically when i call it up later to change the the value of $strFace (ie: $strFace = "Arial";, echo $string;), it doesnt seem to change the $strFace value in $string.

Anyone no how to solve this? :)

only solution i can think of is to split the $string into two and then wack the changing value inbetween the two split strings when outputed etc etc - but there must be another way :|

tar,
Dom :D

[Edited on 22-01-2005 by Dom]


Dom

posted on 21st Jan 05 at 22:09

quote:
Originally posted by Tim
Yes... but you really should either escape the double quotes with a backslash, or just use single quotes (so it gets processed correctly and is a bit more readable)...

ie. $html = "<font face='Arial'>$text</font>";

or

$html = "<font face=\"Arial\">$text</font>";


[Edited on 21-01-2005 by Tim]


tar mate, that actually solved a load of errors that came up :lol::lol:


Tim

posted on 21st Jan 05 at 21:33

Yes... but you really should either escape the double quotes with a backslash, or just use single quotes (so it gets processed correctly and is a bit more readable)...

ie. $html = "<font face='Arial'>$text</font>";

or

$html = "<font face=\"Arial\">$text</font>";


[Edited on 21-01-2005 by Tim]


Dom

posted on 21st Jan 05 at 21:33

quote:
Originally posted by Laney
quote:
Originally posted by Dom
if i had a php string, $html = "<font face=""arial"">$text</font>";, and i assinged hello to $text, would it get printed if i did an echo of $html?

i know this is basic, but i cant find anything by doing a google abit this :(

tar,
Dom :thumbs:


<font face="arial">$text</font> would be printed IIRC

Try making it $html = "<font face='arial'>".$text."</font>" ?


nice one boss :thumbs:


Laney

posted on 21st Jan 05 at 21:32

quote:
Originally posted by Dom
if i had a php string, $html = "<font face=""arial"">$text</font>";, and i assinged hello to $text, would it get printed if i did an echo of $html?

i know this is basic, but i cant find anything by doing a google abit this :(

tar,
Dom :thumbs:


<font face="arial">$text</font> would be printed IIRC

Try making it $html = "<font face='arial'>".$text."</font>" ?


Smiffie

posted on 21st Jan 05 at 21:31

i know SFA about scripting dude


Dom

posted on 21st Jan 05 at 21:28

quote:
Originally posted by Smiffie
quote:
Originally posted by Dom
quote:
Originally posted by Smiffie
change from ur last question :P

hahahaha...im tired and not thinking right mate :lol:

answer the question though :P


sorry, i can't give u any kind of educated answer :(


GTF then you dumbass biatch :|...no really, you dont know?? its doing my head it and i cant be asked to try it out because i know my current script is gonna chuck out errors all over the place :lol::lol:


Smiffie

posted on 21st Jan 05 at 21:27

quote:
Originally posted by Dom
quote:
Originally posted by Smiffie
change from ur last question :P

hahahaha...im tired and not thinking right mate :lol:

answer the question though :P


sorry, i can't give u any kind of educated answer :(


Dom

posted on 21st Jan 05 at 21:26

quote:
Originally posted by Smiffie
change from ur last question :P

hahahaha...im tired and not thinking right mate :lol:

answer the question though :P


Smiffie

posted on 21st Jan 05 at 21:24

change from ur last question :P


Dom

Icon depicting mood of post posted on 21st Jan 05 at 21:22

if i had a php string, $html = "<font face=""arial"">$text</font>";, and i assinged hello to $text, would it get printed if i did an echo of $html?

i know this is basic, but i cant find anything by doing a google abit this :(

tar,
Dom :thumbs:

Edit - new question at bottom :)

[Edited on 22-01-2005 by Dom]