Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help me on PHP code


Guest

Recommended Posts

Hi I want to write some code for my shop

 

the ideal code like that

 

==========================

if session(register.login) = true

 

display abc.jpg

 

else

 

display efg.jpg

 

==========================

 

Can anyone help me translate it into real PHP code ?

 

many many thanks

Link to comment
Share on other sites

I think this is what you want:

 

<?php
 if ( tep_session_is_registered('customer_id') ) {
echo tep_image(DIR_WS_IMAGES . 'abc.jpg');
 } else {
echo tep_image(DIR_WS_IMAGES . 'efg.jpg');
 }
?>

It displays abc.jpg if the person is logged in, and efg.jpg if they're not. It also presumes the image files are in the images folder with all your other osC images.

 

Did you see my answer to your post in the template and images forum about resizing images?

:unsure:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

I think this is what you want:

 

<?php
 if ( tep_session_is_registered('customer_id') ) {
echo tep_image(DIR_WS_IMAGES . 'abc.jpg');
 } else {
echo tep_image(DIR_WS_IMAGES . 'efg.jpg');
 }
?>

It displays abc.jpg if the person is logged in, and efg.jpg if they're not. It also presumes the image files are in the images folder with all your other osC images.

 

Did you see my answer to your post in the template and images forum about resizing images?

:unsure:

 

germ

 

Yes, the image is work fine, I forgot say thank you to you

 

I will try this code and thank you once again

 

many thanks

Link to comment
Share on other sites

germ

 

Yes, the image is work fine, I forgot say thank you to you

 

I will try this code and thank you once again

 

many thanks

 

 

BTW, germ

 

I have a problem on my create_account.php

 

it allow duplicate sign up with same email, but now I upload a clean create_account.php, it is work fine, I checked the code few times, but really don't know where is the error.

 

if you have time can you help me take a look at it

 

here is the file with error

 

create_account.zip

 

Thank you very much

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...