How do I format text in a php block? I tried echo "</p><font face="Forte">","<font color="#FF0000" size="4"><b>Reserve Not Met</b></font></font>"; It just throws up a parse error!
I need to be able to change font colour, size and face if possible.
Gerry
Any time you're using the php echo statement with double quotes you have to comment out any double quotes inside the statement or use a single quote. Or you can do it the other way around and use single quotes with double quotes in your html like it normally would be. I prefer to write my echo's like this.
echo '</p><font face="Forte"><font color="#FF0000" size="4"><b>Reserve Not Met</b></font></font>';
If you were to write it the way you want then you'd have to do this.
echo "</p><font face=\"Forte\"><font color=\"#FF0000\" size=\"4\"><b>Reserve Not Met</b></font></font>";
I also want to point out that you don't need the "," in your line of code either so I took it out.
curious why you have two <font> tags though.... ?
Two font tags are a copy/paste cockup when I was doing the post!
Thanks for the quick reply I shall give it a go.
Gerry
What I meant was that you can combine what you wrote I believe.
[code<font color=\"#FF0000\" size=\"4\" face=\"Forte\">
That works great thanks, I learn something new everyday!
One more question if you don't mind. In the same block I include a text file require("location of file ect/highbidderis.txt"); How could I change the font formatting on that?
Thanks for your help!
Gerry
You'd probably be better off doing the formatting in the actual text file. Otherwise, you'll be writing a big routine just to parse the files and then add the html to it. Thats the way I see it anyway, but I'm no PHP guru yet. Bloc could probably do something like this in his sleep.
I can't do it that way as the file is used as a database to store a variable number. I wrote a script for a simple auction for a site I administrate on which uses flat files for storage. I suppose I could call the file from a seperate php page, load the contents into a variable then include that page instead. Then I should be able to do something along the lines of echo '</p><font face="Forte"><font color="#FF0000" size="4"><b>$variable</b></font></font>';
Gerry
Can you give me an example of some of the lines in your files? I'd like to play with this and see what I can come up with. No promises though.
The content of the file in question would be (at this very moment)
QuoteThe current High Bid is from imagedktr With a Bid of Ã,£10
obviously the bidders name and amount changes with every successful bid!
This is written into the file from the main auction php script. Including the file simply displays the above text.
Gerry
So it's only going to be one line each time someone bids? Its never going to be more than that? That shouldn't be too hard I think.
Each time the bid is higher anyway! I suppose I could write the formatting to the text file then simply read the lot back into the block if that would work i.e. the file content would become echo '</p><font face="Forte"><font color="#FF0000" size="4"><b>The current High Bid is from imagedktr With a Bid of ÂÃ,£10</b></font></font>';
Gerry
If its a set style you want on this, maybe simply do this:
echo '<span style="font: Forte #FF0000 large bold;">';
require("location of file ect/highbidderis.txt");
echo '</span>';
Thanks Block but that has no effect at all to the formatting of the text! There's probably a simple explanation to this but it's proving elusive to me.
Gerry
The file you include..maybe better to simply include the formatting in it I think.