![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Dec 2001
Posts: 7,952
|
PHP Help needed..
I'm trying to generate static html pages from a php page which I have down no problem except, I dont know how to get it to also then on the html page I generate insert php code so that when a user loads the page it then does that php.
Does that make sense? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 | |
Confirmed User
Join Date: Jul 2002
Location: Bay Area
Posts: 4,012
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: Mar 2002
Posts: 3,893
|
![]()
__________________
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Jul 2003
Location: Dallas, TX
Posts: 1,706
|
I'm confused. Can you describe it better?
__________________
Joe, Master Web Developer, ICQ: 280 889 133 CollegeSucks.com: Trade Links (PR 6) / $2 Advertising On average, my site sends back 3 times as much traffic. Trade links? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 | |
Confirmed User
Join Date: May 2002
Location: Calgary, Canada
Posts: 1,342
|
Quote:
__________________
<b><a href="http://www.hotlinkprotector.com"><font color="yellow">Hotlink Protector</font></a> - Protect all your file types from hotlinking the professional way. <br> See a demo <a href="http://www.hotlinkprotector.com/demo.html"><font color="yellow">here</font></a>, and testimonials <a href="http://www.hotlinkprotector.com/testimonials.html"><font color="yellow">here</font></a><br>ICQ: 146423631 |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Join Date: Aug 2001
Location: New Orleans
Posts: 1,680
|
I'm a bit unclear about what you're trying to do. Are you generating a page using php that has php code within it that you want parsed? If so, just do the code in the first place and output the results.
__________________
<CENTER><A HREF="http://www.hot-off-bourbon.com/" target="_blank"><IMG SRC="http://www.hot-off-bourbon.com/images/hob-logosmall.jpg" border="0"></A> <FONT face="Comic Sans MS" SIZE="-1"><I>Mardi Gras, Spring Break, Wet-T, Night Club Action, UpSkirt, Oil Wrestling, Voyeur</I></FONT></CENTER> |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
So Fucking Banned
Join Date: Jul 2003
Posts: 1,595
|
Example.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Join Date: Aug 2002
Location: Sydney, Australia
Posts: 6,103
|
Come on ppl, he wants to generate a .php file with html generated + php code so the end user gets the generated code and php code.
I understand you mate. However I have never done that before so I can't help you. ![]()
__________________
--- |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Confirmed User
Join Date: Aug 2001
Location: New Orleans
Posts: 1,680
|
What throws me off is the part "when a user loads the page it then does that php" because php is server side. Once the user loads the page, it's done and simply text.
__________________
<CENTER><A HREF="http://www.hot-off-bourbon.com/" target="_blank"><IMG SRC="http://www.hot-off-bourbon.com/images/hob-logosmall.jpg" border="0"></A> <FONT face="Comic Sans MS" SIZE="-1"><I>Mardi Gras, Spring Break, Wet-T, Night Club Action, UpSkirt, Oil Wrestling, Voyeur</I></FONT></CENTER> |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Confirmed User
Industry Role:
Join Date: Dec 2001
Posts: 7,952
|
Example
Page is amateurs.php which does a select * from database where category = amateurs it then prints out the galleries with links etc. I turn that into a static html page so my mysql server is not hit every time someone loads the page. But I want my toplist on the page so how do I get that? So to get my toplist updated i'd need to do a include(toplist) with the php dealies but that causes when I generate the page for it to do the toplist right then and there. I want it to print on my html page the < ? include ( " toplist.php " ) ? > Using autogallery which is a cgi script it works fine, but how is it done in php? Somehow its done or Itgp, BoxxTgp or any other php tgp script could not let you include php in a php script? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 | |
Confirmed User
Industry Role:
Join Date: Dec 2001
Posts: 7,952
|
Quote:
![]() Maybe a php board might be better to ask, was hoping someone out there had done something like this. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 | |
Confirmed User
Join Date: Nov 2002
Posts: 880
|
Quote:
If the generated file extnsion is .html you cannot execute it as a php script nor include another php in it. Alternatively if the file extension is not a problem then save the generated file as .php then you can "include" another php code to it. I hope that helps. ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 | |
Confirmed User
Industry Role:
Join Date: Dec 2001
Posts: 7,952
|
Quote:
You can't parse both php and cgi on the same extension though. I dont understand what you mean though to save the file as php then include another php file in it. I dont want to manually add to the file since I want to do it hourly and to edit 50 pages would not be fun that often. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 | |
Confirmed User
Join Date: Nov 2002
Posts: 880
|
Quote:
As for the rest..If I'm correct you are using a script that creates & writes static pages periodically. And have another .php script which needs to run whenever that static pages called. As you have access to apache & configure php to parse .html, put that in your generated .html pages as text while creating them. < ? php include("myscript.html"); ? > or am I missing something here? |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
Confirmed User
Industry Role:
Join Date: Dec 2001
Posts: 7,952
|
You can't do
print <? include ( toplist.php ) in a php file or it will print it you also can't use the <? parts or it wants to parse what it is inside. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 | |
Confirmed User
Join Date: Aug 2001
Location: New Orleans
Posts: 1,680
|
Quote:
__________________
<CENTER><A HREF="http://www.hot-off-bourbon.com/" target="_blank"><IMG SRC="http://www.hot-off-bourbon.com/images/hob-logosmall.jpg" border="0"></A> <FONT face="Comic Sans MS" SIZE="-1"><I>Mardi Gras, Spring Break, Wet-T, Night Club Action, UpSkirt, Oil Wrestling, Voyeur</I></FONT></CENTER> |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 | |
Confirmed User
Join Date: May 2002
Posts: 258
|
Quote:
PHP Code:
__________________
"Bite my shiny metal ass!" |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 | |
Registered User
Join Date: Jul 2003
Posts: 15
|
Quote:
Make a shell script to execute php at the command line to parse the php file and then output the result to an html file by running: /usr/bin/php -q script.php > index.html . You may need to play around with the path to the php binary if it isn't in /usr/bin. Include the toplist by using server side includes Use a cronjob to execute the shell script every night to create a new html file. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#19 | |
Confirmed User
Join Date: Nov 2002
Posts: 880
|
Quote:
![]() Also, if you don't need .html extension for any special reason and just wanted to make less hits to mysql here is an alternative, Just put them in a text file then update only that file periodically and make your pages to read data from it. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#20 | |
Confirmed User
Industry Role:
Join Date: Dec 2001
Posts: 7,952
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#21 |
Confirmed User
Join Date: Jul 2002
Location: A warm place.
Posts: 634
|
I think you should use jpcache instead. does the same gig without clottering your system with files that you'd need to maintain later.
__________________
I couldn't possibly know what I'm talking about, I'm completely, absolutely and definitively out of my fucking mind. |
![]() |
![]() ![]() ![]() ![]() ![]() |