1
offside
try to add an image, keep getting errors.
  • 2007/5/11 23:27

  • offside

  • Just popping in

  • Posts: 71

  • Since: 2004/10/7


Hello peeps,

I am using googlemap latest version, and all I am trying to do is to add a little image on top of the manage point page.

I have worked out where to add it but just dont seem to able to, as I keep getting php errors.
I need to put this code
<p align="center"><img border="0" src="/IMG/gmap.gif">p>


in the php file just above this code

echo "

"._MD_TITLE."

"
;


simple if you know how to code!


would appreciate your help

Thank you!

2
JMorris
Re: try to add an image, keep getting errors.
  • 2007/5/12 1:07

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


Try this and see if it helps...

?>




HTH.

James
Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.

3
Catzwolf
Re: try to add an image, keep getting errors.
  • 2007/5/12 1:57

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


actually do this:

echo '


'._MD_TITLE.'


';

4
JMorris
Re: try to add an image, keep getting errors.
  • 2007/5/12 2:09

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


The errors are cause because the file is being parsed as PHP while you are feeding it HTML characters. This will cause a fatal error: unexpected "<" at line xxx.

5 characters of code vs. 7 characters of code as Catz suggests, either way, it will work.

On such a small scale, 2 characters of code are meaningless, but if you are in the habit of echo'ing out HTML on a large scale, you're going to increase the load on your server because it has to load more characters into memory to do the same job.

Now, an exception is when you have a lot of PHP variables mixed in with your HTML. In those situations, the echo method can be more efficient.

As a rule of thumb, it's always best to use as little code as possible to get the job done, provided you've satisfied all conditions for security, stability, and functionality.

Just my opinion, for what it's worth.
Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.

5
offside
Re: try to add an image, keep getting errors.
  • 2007/5/12 17:49

  • offside

  • Just popping in

  • Posts: 71

  • Since: 2004/10/7


Quote:

Catzwolf wrote:
actually do this:

echo '


'._MD_TITLE.'


';


That worked like a charm thanks to all of you guys!


Cheers.

Login

Who's Online

329 user(s) are online (283 user(s) are browsing Support Forums)


Members: 0


Guests: 329


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits