![]() |
![]() |
![]() |
||||
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 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";?>'); ?> 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";?> |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 | |
Unregistered Abuser
Industry Role:
Join Date: Oct 2007
Posts: 15,547
|
Quote:
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
So Fucking What
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 ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
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"; } ?> |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
|
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
So Fucking What
Industry Role:
Join Date: Jul 2006
Posts: 17,189
|
Quote:
![]() its pretty basic sweety
__________________
best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
|
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
So Fucking What
Industry Role:
Join Date: Jul 2006
Posts: 17,189
|
Quote:
![]() ![]() ![]() ![]()
__________________
best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
So Fucking What
Industry Role:
Join Date: Jul 2006
Posts: 17,189
|
php is hell
__________________
best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed User
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
|
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
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";?>'); ?> 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;?>" /> |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 | |
So Fucking What
Industry Role:
Join Date: Jul 2006
Posts: 17,189
|
Quote:
![]() PHP is HELL ! HELL !
__________________
best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
So Fucking What
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 ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
So Fucking What
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 ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 |
Now choke yourself!
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.
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
Now choke yourself!
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.
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 |
Confirmed User
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
|
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#19 | ||
Confirmed User
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
|
Quote:
Quote:
__________________
Your post count means nothing. |
||
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#20 | |
So Fucking What
Industry Role:
Join Date: Jul 2006
Posts: 17,189
|
They're fucking with me subliminally
Quote:
__________________
best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#21 |
So Fucking What
Industry Role:
Join Date: Jul 2006
Posts: 17,189
|
moths fart. good for you. help find its way outside
![]()
__________________
best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#22 |
So Fucking What
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 ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#23 |
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#24 | |
Confirmed User
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
|
Quote:
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. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#25 | |
So Fucking Banned
Join Date: Jun 2007
Posts: 2,036
|
Quote:
This looks kinda nice Ben - covers a few contingencies ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#26 | |
So Fucking What
Industry Role:
Join Date: Jul 2006
Posts: 17,189
|
Quote:
![]() ![]() ![]() ![]()
__________________
best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#27 |
Confirmed User
Join Date: May 2007
Posts: 1,152
|
thanks for the info!
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#28 |
Confirmed User
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |