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 10-24-2007, 08:05 PM   #1
Wolfy
Confirmed User
 
Wolfy's Avatar
 
Industry Role:
Join Date: Dec 2003
Location: Wisconsin
Posts: 3,574
php question

I am using this code to display a page included in another:

Code:
<?php include('<?echo "$id";?>'); ?>
So I link this way:

www.mysite.com/?id=1

How do I make links on the page to advance 1 or decrease 1?

Code:
<a href="http://www.mysite.com/<?echo "$id+1";?>

or

<a href="http://www.mysite.com/<?echo "$id-1";?>
Wolfy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 09:16 PM   #2
psili
Confirmed User
 
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
I'm dumb. But I like to post sometimes. That, and I'm unsure what you're trying to include. However,

<a href="http://www.mysite.com/<?PHP ($_GET["id"] + 1) ?>">

might work (other than bad quote escaping I might have). Also, are you using some URL rewriting or are your files really named www.mysite.com/1 , www.mysite.com/2 , www.mysite.com/[x] ?

blah blah blah... here's a bump since I'm dumb
__________________
Your post count means nothing.
psili is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 09:18 PM   #3
papill0n
Unregistered Abuser
 
Industry Role:
Join Date: Oct 2007
Posts: 15,547
Quote:
Originally Posted by psili View Post
I'm dumb. But I like to post sometimes. That, and I'm unsure what you're trying to include. However,

<a href="http://www.mysite.com/<?PHP ($_GET["id"] + 1) ?>">

might work (other than bad quote escaping I might have). Also, are you using some URL rewriting or are your files really named www.mysite.com/1 , www.mysite.com/2 , www.mysite.com/[x] ?

blah blah blah... here's a bump since I'm dumb
haha dont be so hard on yourself dude - that code should work perfectly
papill0n is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 09:20 PM   #4
2012
So Fucking What
 
2012's Avatar
 
Industry Role:
Join Date: Jul 2006
Posts: 17,189
if(isset($_GET['id']))
{
$id = $_GET['id'];;
}

echo myshit $id
__________________
best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself
2012 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 09:20 PM   #5
papill0n
Unregistered Abuser
 
Industry Role:
Join Date: Oct 2007
Posts: 15,547
this was posted on another board

Code:
<?php
if ( !eregi('http', $_GET['id']) && is_numeric($_GET['id']) && file_exists($_GET['id'].'.html') )
{
    include( $_GET['id'].'.html';
    $next_page_id = $_GET['id'] + 1;
    $prev_page_id = $_GET['id'] - 1;
}
else 
{
    echo "error";
}
?>
papill0n is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 09:22 PM   #6
psili
Confirmed User
 
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
Quote:
Originally Posted by fartfly View Post
if(isset($_GET['id']))
{
$id = $_GET['id'];;
}

echo myshit $id
Fuck that shit, motherfucker...

echo "myshit ".(isset($_GET["id"]) ? $_GET["id"] : " is exit only");

sorry... i'll take my meds now and go to sleep.
__________________
Your post count means nothing.
psili is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 09:24 PM   #7
2012
So Fucking What
 
2012's Avatar
 
Industry Role:
Join Date: Jul 2006
Posts: 17,189
Quote:
Originally Posted by psili View Post
Fuck that shit, motherfucker...

echo "myshit ".(isset($_GET["id"]) ? $_GET["id"] : " is exit only");

sorry... i'll take my meds now and go to sleep.


its pretty basic sweety
__________________
best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself
2012 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 09:32 PM   #8
psili
Confirmed User
 
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
Quote:
Originally Posted by fartfly View Post


its pretty basic sweety
I was born with flippers for hands and I still haven't mastered dolphin ninja code yet.
Gimme time.
Just a few more *fwap fwap fwap*s.
__________________
Your post count means nothing.
psili is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 09:33 PM   #9
2012
So Fucking What
 
2012's Avatar
 
Industry Role:
Join Date: Jul 2006
Posts: 17,189
Quote:
Originally Posted by psili View Post
I was born with flippers for hands and I still haven't mastered dolphin ninja code yet.
Gimme time.
Just a few more *fwap fwap fwap*s.
__________________
best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself
2012 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 09:37 PM   #10
2012
So Fucking What
 
2012's Avatar
 
Industry Role:
Join Date: Jul 2006
Posts: 17,189
php is hell
__________________
best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself
2012 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 09:56 PM   #11
psili
Confirmed User
 
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
Quote:
Originally Posted by fartfly View Post
php is hell
Sorry Wolfy, to go all personal on your thread....

But in reply to "php is hell".....

I was a "liberal arts" major, so my take on web development is based on my "flipper" post, so the following will probably offend the CS degree'ers:

1. After HTML, javascript and that client-side shit, the next thing I started to learn was PHP.
2. Then I took up some java. Wrote a couple of stand-alone apps, played with spring and struts frameworks and hated the xml configurations and getters and setters and all the wiring in, even if the IDE helped hook that up.
3. Tried ruby on rails for a bit. Gheyest fucking moniker ever, "Ruby on Rails". What dickhead made that up? Probably the same assholes who monikered "Gusty Gibbon" . Yet, as ghey as saying "yea, I did this in 'ruby on rails', it was a great framework for prototyping web projects.

Then, one day, I read a post on GFY about coding by banging franks'n'beans on the keyboard. The poster never monikered that process, but I've perfected it. So, long story short of no one asking for a story is.... what the fuck was I posting about?
__________________
Your post count means nothing.
psili is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 10:02 PM   #12
xroach
Confirmed User
 
Join Date: Feb 2002
Location: vancouver, bc
Posts: 963
[QUOTE=Wolfy;13283820]I am using this code to display a page included in another:

Code:
<?php include('<?echo "$id";?>'); ?>
should be

Code:
<?php include("$id"); ?>




Code:
<a href="http://www.mysite.com/<?echo "$id+1";?>

or

<a href="http://www.mysite.com/<?echo "$id-1";?>
Code:
<a href="http://www.mysite.com/<?echo $id-1;?>" />
xroach is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 10:16 PM   #13
2012
So Fucking What
 
2012's Avatar
 
Industry Role:
Join Date: Jul 2006
Posts: 17,189
Quote:
Originally Posted by psili View Post
Sorry Wolfy, to go all personal on your thread....

But in reply to "php is hell".....

I was a "liberal arts" major, so my take on web development is based on my "flipper" post, so the following will probably offend the CS degree'ers:

1. After HTML, javascript and that client-side shit, the next thing I started to learn was PHP.
2. Then I took up some java. Wrote a couple of stand-alone apps, played with spring and struts frameworks and hated the xml configurations and getters and setters and all the wiring in, even if the IDE helped hook that up.
3. Tried ruby on rails for a bit. Gheyest fucking moniker ever, "Ruby on Rails". What dickhead made that up? Probably the same assholes who monikered "Gusty Gibbon" . Yet, as ghey as saying "yea, I did this in 'ruby on rails', it was a great framework for prototyping web projects.

Then, one day, I read a post on GFY about coding by banging franks'n'beans on the keyboard. The poster never monikered that process, but I've perfected it. So, long story short of no one asking for a story is.... what the fuck was I posting about?
im smart like the professor on Gilligan's island ... it must be my name

PHP is HELL !
HELL !
__________________
best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself

Last edited by 2012; 10-24-2007 at 10:18 PM..
2012 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 10:20 PM   #14
2012
So Fucking What
 
2012's Avatar
 
Industry Role:
Join Date: Jul 2006
Posts: 17,189
you think php is more efficient then ruby... okee dokkeeeee
__________________
best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself

Last edited by 2012; 10-24-2007 at 10:22 PM..
2012 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 10:23 PM   #15
2012
So Fucking What
 
2012's Avatar
 
Industry Role:
Join Date: Jul 2006
Posts: 17,189
i like smarty. I just think just straight hard coding shit is always a waste in most situations. anything that can save you time is god.
__________________
best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself
2012 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 10:24 PM   #16
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Out of all of them, Ben's is the safest, because he forces the .html extension, tests for a numeric, and greps out full URLs..however he loses points for not checking for directory trans.

See me after class, all of you.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 10:28 PM   #17
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Part two: It's better to use fpassthru/file_get_contents/etc to include if you don't actually need it to be parsed by PHP.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 10:48 PM   #18
psili
Confirmed User
 
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
Quote:
Originally Posted by fartfly View Post
you think php is more efficient then ruby... okee dokkeeeee
I'm not a computer science person and I don't develop compiled code as an occupation, so when you get down to whatever's interpreting the script, I can't tell you if PHP or RoR is faster. That, and I like to write endless "while" statements for fun. But...

Between PHP and Ruby all I've read and have tried :
1. LAMP + some framework "[smarty / symphony / blah blah blah]
2. Linux, mysql, apache + mod_proxy, mongrel + RoR.

If I could focus on 1 or 2, I'd go number 2 as it's a pretty savage framework (i've bailed on java for some reason... don't know why thought). Lately, even for PHP projects my stupid table names and schematas are created around the RoR naming conventions. Unfortunately, if I went with RoR sometimes, finding reasonably priced help might be an issue along with scalability issues if there are any (yea, in either case, throw a couple of more servers and mongrel processes in the mix) but... from what I've found in my latest client it's more of a support issue than anything else. Everyone knows PHP. Not everyone knows Ruby. And then you have "flipper" boy writing funky shit... so if "flipper" boy is writing funky shit, it might as well be in a script that's more well-known than another.

or some crap like that.
__________________
Your post count means nothing.
psili is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 10:55 PM   #19
psili
Confirmed User
 
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
Quote:
Originally Posted by fartfly View Post
i like smarty. I just think just straight hard coding shit is always a waste in most situations. anything that can save you time is god.
BTW, your nick reminded me of this bash.org quote:

Quote:
<kerushixx> dude, i just saw a moth fart!
<tulam> 0_o
<tulam> how do you know it farted?
<kerushixx> it flew in a straight line
anyway...
__________________
Your post count means nothing.
psili is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 10:59 PM   #20
2012
So Fucking What
 
2012's Avatar
 
Industry Role:
Join Date: Jul 2006
Posts: 17,189
They're fucking with me subliminally

Quote:
Originally Posted by psili View Post
I'm not a computer science person and I don't develop compiled code as an occupation, so when you get down to whatever's interpreting the script, I can't tell you if PHP or RoR is faster. That, and I like to write endless "while" statements for fun. But...

Between PHP and Ruby all I've read and have tried :
1. LAMP + some framework "[smarty / symphony / blah blah blah]
2. Linux, mysql, apache + mod_proxy, mongrel + RoR.

If I could focus on 1 or 2, I'd go number 2 as it's a pretty savage framework (i've bailed on java for some reason... don't know why thought). Lately, even for PHP projects my stupid table names and schematas are created around the RoR naming conventions. Unfortunately, if I went with RoR sometimes, finding reasonably priced help might be an issue along with scalability issues if there are any (yea, in either case, throw a couple of more servers and mongrel processes in the mix) but... from what I've found in my latest client it's more of a support issue than anything else. Everyone knows PHP. Not everyone knows Ruby. And then you have "flipper" boy writing funky shit... so if "flipper" boy is writing funky shit, it might as well be in a script that's more well-known than another.

or some crap like that.
flipper is always writing shit in any language. Your right, if you are going to develop something do it in php so you can sell it. That shit gets old after awhile though ... you're always supporting bullshit
__________________
best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself
2012 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 11:07 PM   #21
2012
So Fucking What
 
2012's Avatar
 
Industry Role:
Join Date: Jul 2006
Posts: 17,189
Quote:
Originally Posted by psili View Post
BTW, your nick reminded me of this bash.org quote:



anyway...
moths fart. good for you. help find its way outside
__________________
best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself
2012 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 11:24 PM   #22
2012
So Fucking What
 
2012's Avatar
 
Industry Role:
Join Date: Jul 2006
Posts: 17,189
i used to give a shit until I realized something.

Im makeing someone else $$$

fuck that

do whatcha like

I guess you still are as an affiliate but ...
__________________
best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself

Last edited by 2012; 10-24-2007 at 11:25 PM.. Reason: were no man has gone before
2012 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-25-2007, 12:18 AM   #23
Chariott
Confirmed User
 
Join Date: Nov 2006
Location: http://UUGallery.com http://UUGallery.com http://UUGallery.com http://UUGallery.com http://UUGallery.com http://UUGallery.com
Posts: 361
If register globals turned on, you shouldn't write this:
<?php include('<?echo "$id";?>'); ?>
as it has a vulnerability flaw.

Just set
?id=/etc/passwd
or
?id=/etc/shadow
and will get any file you want which is stored at the server.
__________________

UUGallery v3.37 builder plugin for Wordpress!
Now it builds FLV VIDEO Galleries! It grabs galleries from FHG's, generates thumbnails, resizes originals,
arranges within your template and posts a gallery within 1 click!
Start making money right now!
ICQ# 475-719-552, Email+MSN: msnaddress[-~at~-]uusoftware.com
Chariott is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-25-2007, 12:19 AM   #24
psili
Confirmed User
 
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
Quote:
Originally Posted by fartfly View Post
i used to give a shit until I realized something.

Im makeing someone else $$$

fuck that

do whatcha like

I guess you still are as an affiliate but ...
If this post was directed my way, I had no intention of offense.
And if anything I posted was taken as such, my apologies; nothing I posted in this thread was meant as "bad". Other threads toward other poster might be a different story.
__________________
Your post count means nothing.
psili is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-25-2007, 12:50 AM   #25
GreyWolf
So Fucking Banned
 
Join Date: Jun 2007
Posts: 2,036
Quote:
Originally Posted by RageCash-Ben View Post
this was posted on another board

Code:
<?php
if ( !eregi('http', $_GET['id']) && is_numeric($_GET['id']) && file_exists($_GET['id'].'.html') )
{
    include( $_GET['id'].'.html';
    $next_page_id = $_GET['id'] + 1;
    $prev_page_id = $_GET['id'] - 1;
}
else 
{
    echo "error";
}
?>

This looks kinda nice Ben - covers a few contingencies
GreyWolf is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-25-2007, 01:28 AM   #26
2012
So Fucking What
 
2012's Avatar
 
Industry Role:
Join Date: Jul 2006
Posts: 17,189
Quote:
Originally Posted by psili View Post
If this post was directed my way, I had no intention of offense.
And if anything I posted was taken as such, my apologies; nothing I posted in this thread was meant as "bad". Other threads toward other poster might be a different story.
no way
__________________
best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself
2012 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-25-2007, 05:11 AM   #27
divine116
Confirmed User
 
Join Date: May 2007
Posts: 1,152
thanks for the info!
divine116 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-25-2007, 06:06 AM   #28
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
not sure if I should be surprised or not surprised, but the better way to do this is probably with .htaccess and ReWrites.

that way, you just rewrite
site.com/X [where X is a digit]

to sitefiles/pages/x.html or whatever you want.

No PHP, no exploits, and no overhead.
quantum-x 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.