Jump to content

Archived

This topic is now archived and is closed to further replies.

FlyingIsFun1217

Html-->PHP...

Recommended Posts

Hey,

I was wondering, how would a simple html code snippet like this:

[code]<a href="aim:GoIM?screenname=myscreenname">
<img src="http://api.oscar.aol.com/SOA/key=fl1aQV3Tmy/presence/myscreennameagain" border="0"/></a>[/code]

be changed to php code?

Thanks for the help!
FlyingIsFun1217

Share this post


Link to post
Share on other sites
[code]<?php
echo '<a href="aim:GoIM?screenname=myscreenname">
<img src="http://api.oscar.aol.com/SOA/key=fl1aQV3Tmy/presence/myscreennameagain" border="0"/></a>';
?>[/code]

Share this post


Link to post
Share on other sites
hmmm...

That gives me an error...
[quote]Parse error: parse error, unexpected T_STRING in C:\Program Files\Abyss Web Server\Hosted Pages & Files\sphpblog-0.4.8\scripts\sb_theme.php on line 37[/quote]

I think this might be due to the way that the code that it goes in is set up:
[code]$result = array();
$result[ 'title' ] = 'Am I on AIM?';
$result[ 'content' ] = 'content(php code to retireve image) goes here';

return ( $result );
}[/code]

If you would like to see what I am kinda trying to change, check out [url=http://www.simplephpblog.com/static.php?page=adding_php_block]this page[/url]

Thanks again!
FlyingIsFun1217

Share this post


Link to post
Share on other sites
[code]<?php
echo '<a href="aim:GoIM?screenname=myscreenname">
<img src="http://api.oscar.aol.com/SOA/key=fl1aQV3Tmy/presence/myscreennameagain" border="0"></a>';
?>[/code]

There is no unescaped characters in that code above.

Share this post


Link to post
Share on other sites
So would it be set up as so?
[code]function menu_aim_presence () {
// AIM Presence Block

$result = array();
$result[ 'title' ] = 'Am I on AIM?';
$result[ 'content' ] = 'echo '<a href="aim:GoIM?screenname=myscreenname">
<img src="http://api.oscar.aol.com/SOA/key=fl1aQV3Tmy/presence/myscreennameagain" border="0"></a>';

return ( $result );
} [/code]
If so, I am still getting an error for some reason:
[quote]Parse error: parse error, unexpected T_STRING in C:\Program Files\Abyss Web Server\Hosted Pages & Files\sphpblog-0.4.8\scripts\sb_theme.php[/quote]

Thanks for helpin a noob...
FlyingIsFun1217

Share this post


Link to post
Share on other sites
remove the "echo '" from that line.  echo is to output something to the browser.

Share this post


Link to post
Share on other sites
[quote]echo is to output something to the browser[/quote]

Sometimes I think I'm going crazy... Thanks for reminding me!
FlyingIsFun1217

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.