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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 08-04-2003, 12:38 AM   #1
4Pics
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?
4Pics is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2003, 12:42 AM   #2
arial
Confirmed User
 
arial's Avatar
 
Join Date: Jul 2002
Location: Bay Area
Posts: 4,012
Quote:
Originally posted by 4Pics
Does that make sense?
That's a big negative.
arial is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2003, 12:46 AM   #3
Evil1
Confirmed User
 
Industry Role:
Join Date: Mar 2002
Posts: 3,893
__________________
Evil1 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2003, 12:56 AM   #4
joseph4829
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?
joseph4829 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2003, 12:58 AM   #5
michaelw
Confirmed User
 
Join Date: May 2002
Location: Calgary, Canada
Posts: 1,342
Quote:
Originally posted by joseph4829
I'm confused. Can you describe it better?
yea - and this time in english please
__________________
<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
michaelw is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2003, 01:02 AM   #6
fiveyes
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>
fiveyes is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2003, 01:09 AM   #7
teenjump
So Fucking Banned
 
Join Date: Jul 2003
Posts: 1,595
Example.
teenjump is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2003, 01:11 AM   #8
Zorgman
Confirmed User
 
Zorgman's Avatar
 
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.
__________________
---
Zorgman is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2003, 01:20 AM   #9
fiveyes
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>
fiveyes is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2003, 01:45 AM   #10
4Pics
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?
4Pics is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2003, 01:46 AM   #11
4Pics
Confirmed User
 
Industry Role:
Join Date: Dec 2001
Posts: 7,952
Quote:
Originally posted by Zorgman
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.
Thanks

Maybe a php board might be better to ask, was hoping someone out there had done something like this.
4Pics is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2003, 01:54 AM   #12
Arty
Confirmed User
 
Join Date: Nov 2002
Posts: 880
Quote:
Originally posted by 4Pics
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?
I'm not sure if that is what you are asking but,

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.
Arty is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2003, 02:04 AM   #13
4Pics
Confirmed User
 
Industry Role:
Join Date: Dec 2001
Posts: 7,952
Quote:
Originally posted by Arty


I'm not sure if that is what you are asking but,

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.
Maybe you didn't know but you can configure apache to parse php/cgi/perl/whatever as any extension you want.

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.
4Pics is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2003, 02:21 AM   #14
Arty
Confirmed User
 
Join Date: Nov 2002
Posts: 880
Quote:
Originally posted by 4Pics


Maybe you didn't know but you can configure apache to parse php/cgi/perl/whatever as any extension you want.

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.
Of course you can configure apache to parse any extension, but I was talking about defaults here.

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?

Last edited by Arty; 08-04-2003 at 02:29 AM..
Arty is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2003, 03:20 AM   #15
4Pics
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.
4Pics is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2003, 03:27 AM   #16
fiveyes
Confirmed User
 
Join Date: Aug 2001
Location: New Orleans
Posts: 1,680
Quote:
Originally posted by 4Pics
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.
OK, I see what the problem is! You DO want to print the php code to the static page you generate. Just have the page end with an extension that your php parser will handle (usually *.php). That way, everytime the page is called, it will get parsed, your php code will be executed and - VIOLA!
__________________
<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>
fiveyes is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2003, 03:32 AM   #17
Benja
Confirmed User
 
Join Date: May 2002
Posts: 258
Quote:
Originally posted by 4Pics
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.
When u generate ur HTML :

PHP Code:
<?php echo("<?php include(\"blabla.php\"); ?>"); ?>
__________________
"Bite my shiny metal ass!"
Benja is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2003, 03:46 AM   #18
ckm
Registered User
 
Join Date: Jul 2003
Posts: 15
Quote:
Originally posted by 4Pics
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 " ) ? >
Here is what you do:

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.
ckm is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2003, 04:56 AM   #19
Arty
Confirmed User
 
Join Date: Nov 2002
Posts: 880
Quote:
Originally posted by 4Pics
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.
Just follow the Benja

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.

Last edited by Arty; 08-04-2003 at 04:59 AM..
Arty is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2003, 11:47 AM   #20
4Pics
Confirmed User
 
Industry Role:
Join Date: Dec 2001
Posts: 7,952
Quote:
Originally posted by Benja


When u generate ur HTML :

PHP Code:
<?php echo("<?php include(\"blabla.php\"); ?>"); ?>
Thank you, this works perfectly.
4Pics is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2003, 11:57 AM   #21
dnsmonster
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.
dnsmonster is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.