Jump to content


Photo

php include.


  • Please log in to reply
5 replies to this topic

#1 dgnzcn

dgnzcn

    Advanced Member

  • Members
  • PipPipPip
  • 73 posts

Posted 25 June 2013 - 06:51 AM

hello,

my web page links structures like this: index.php?page=contents&pagegroup=products&productid=someproduct  and index.php?page=contents&pagegroup=news&productid=somenews

 

my issue:

i just wanna include images.php file when using pagegroup=products. But i am not need include images.php file without  using pagegroup=products.

 

 

 

 

 



#2 trq

trq

    Advanced Member

  • Administrators
  • 30,732 posts
  • LocationSydney, Australia.

Posted 25 June 2013 - 06:59 AM

This isn't exactly a difficult task, what have you actually tried?

http://thorpesystems.com | http://proemframework.org | http://github.com/trq

SmtpCatcher - A very simple mock sendmail useful for testing PHP mail scripts.
OPM - My Linux package manager.


#3 dgnzcn

dgnzcn

    Advanced Member

  • Members
  • PipPipPip
  • 73 posts

Posted 25 June 2013 - 07:10 AM

Not try but i am included images.php file to content.php  but when i opening news page images.php still showing there. i do not want this. just need show only in products. there is only one file for all contents contents.php

 

how can i do it?


Edited by dgnzcn, 25 June 2013 - 07:13 AM.


#4 Irate

Irate

    Advanced Member

  • Members
  • PipPipPip
  • 358 posts
  • LocationHamburg, Germany
  • Age:17

Posted 25 June 2013 - 07:21 AM

Hint hint: You can test for $_GET['pageproducts'].


Quod placet mihi non placeat tibi. - What I think to be good must not always equal your perception of it.

I am not perfect. I try a lot with the code I provide and I don't guarantee for it to work as I have mostly no option to test it on my mobile phone. I do apologize for any inconvenience I caused, but if I do happen to have helped, liking my posts or marking them as to have solved or answered your question would be nice.

#5 dgnzcn

dgnzcn

    Advanced Member

  • Members
  • PipPipPip
  • 73 posts

Posted 25 June 2013 - 10:43 AM

ok, thanks for the answers. i do following it is working for me.

 

 

if($_GET['pagegroup'] == "products"){
include("images.php");
}

if($_GET['pagegroup'] == "news"){

include("subnews.php");
}



#6 Irate

Irate

    Advanced Member

  • Members
  • PipPipPip
  • 358 posts
  • LocationHamburg, Germany
  • Age:17

Posted 25 June 2013 - 12:07 PM

Good, glad you figured it out.

 

Oh, another hint, use code tags on this forum when posting code.

 

[code][/code] or [ic][/ic]

Quod placet mihi non placeat tibi. - What I think to be good must not always equal your perception of it.

I am not perfect. I try a lot with the code I provide and I don't guarantee for it to work as I have mostly no option to test it on my mobile phone. I do apologize for any inconvenience I caused, but if I do happen to have helped, liking my posts or marking them as to have solved or answered your question would be nice.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com