Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

I need basic PHP teaching...


timmaggs

Recommended Posts

Im trying to add a link at the top of my page to a contacts page threw an image.

 

In html I can do this easy...

 

<a href="contact_us.php"><img scr="contact.jpg"></a>

 

But after doing this on my site, everything links together fine but when something is added to the cart for example and you click on the link this disapears and you look like you have just arrived to the site, the PHP is not working... I can see that I need to learn how to link to things in php... please someone tell me, and not just for this perticular link, can someone give me the knowledge to be able to link to any page using php without losing information?

 

I hope you can understand my waffle.

 

Tim :thumbsup:

Link to comment
Share on other sites

Im trying to add a link at the top of my page to a contacts page threw an image.

 

In html I can do this easy...

 

<a href="contact_us.php"><img scr="contact.jpg"></a>

 

But after doing this on my site, everything links together fine but when something is added to the cart for example and you click on the link this disapears and you look like you have just arrived to the site, the PHP is not working... I can see that I need to learn how to link to things in php... please someone tell me, and not just for this perticular link, can someone give me the knowledge to be able to link to any page using php without losing information?

 

I hope you can understand my waffle.

 

Tim :thumbsup:

 

A link using a picture would look something like this:

 

 <?php echo '<a href="contact_us.php">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'The name of your store, or whatever page it is you are linking to, etc') . '</a>'; ?>

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

A link using a picture would look something like this:

 

 <?php echo '<a href="contact_us.php">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'The name of your store, or whatever page it is you are linking to, etc') . '</a>'; ?>

 

I did this but the end result is still the same, when I click on the link I lose items in my basket etc. I think it must be something to do with "contact_us.php" maybe this should be some clever PHP stuff instead?

 

Tim

Link to comment
Share on other sites

I did this but the end result is still the same, when I click on the link I lose items in my basket etc. I think it must be something to do with "contact_us.php" maybe this should be some clever PHP stuff instead?

 

Tim

 

You need to include the sessions info. You can see how to do this by looking at the links that are already in your header, they start with '<a href="' . tep_href_link

 

 

When you add new links you need to do the same thing. I am pretty sure there is a article in the knowledge base on adding new links.

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...