GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   php question (https://gfy.com/showthread.php?t=779252)

Wolfy 10-24-2007 08:05 PM

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";?>


psili 10-24-2007 09:16 PM

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 :)

papill0n 10-24-2007 09:18 PM

Quote:

Originally Posted by psili (Post 13284046)
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 :thumbsup

2012 10-24-2007 09:20 PM

if(isset($_GET['id']))
{
$id = $_GET['id'];;
}

echo myshit $id

papill0n 10-24-2007 09:20 PM

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";
}
?>


psili 10-24-2007 09:22 PM

Quote:

Originally Posted by fartfly (Post 13284058)
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. :(

2012 10-24-2007 09:24 PM

Quote:

Originally Posted by psili (Post 13284068)
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. :(

:1orglaugh

its pretty basic sweety

psili 10-24-2007 09:32 PM

Quote:

Originally Posted by fartfly (Post 13284077)
:1orglaugh

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.

2012 10-24-2007 09:33 PM

Quote:

Originally Posted by psili (Post 13284091)
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.

:1orglaugh:1orglaugh:1orglaugh:1orglaugh

2012 10-24-2007 09:37 PM

php is hell

psili 10-24-2007 09:56 PM

Quote:

Originally Posted by fartfly (Post 13284100)
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?

xroach 10-24-2007 10:02 PM

[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;?>" />

2012 10-24-2007 10:16 PM

Quote:

Originally Posted by psili (Post 13284132)
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:1orglaugh

PHP is HELL !
HELL !

2012 10-24-2007 10:20 PM

you think php is more efficient then ruby... okee dokkeeeee

2012 10-24-2007 10:23 PM

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.

GrouchyAdmin 10-24-2007 10:24 PM

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 10-24-2007 10:28 PM

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.

psili 10-24-2007 10:48 PM

Quote:

Originally Posted by fartfly (Post 13284196)
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.

psili 10-24-2007 10:55 PM

Quote:

Originally Posted by fartfly (Post 13284204)
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...

2012 10-24-2007 10:59 PM

They're fucking with me subliminally
 
Quote:

Originally Posted by psili (Post 13284259)
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

2012 10-24-2007 11:07 PM

Quote:

Originally Posted by psili (Post 13284271)
BTW, your nick reminded me of this bash.org quote:



anyway...

moths fart. good for you. help find its way outside:thumbsup

2012 10-24-2007 11:24 PM

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 ...

Chariott 10-25-2007 12:18 AM

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.

psili 10-25-2007 12:19 AM

Quote:

Originally Posted by fartfly (Post 13284326)
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.

GreyWolf 10-25-2007 12:50 AM

Quote:

Originally Posted by RageCash-Ben (Post 13284062)
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 :thumbsup

2012 10-25-2007 01:28 AM

Quote:

Originally Posted by psili (Post 13284450)
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 :):):):)

divine116 10-25-2007 05:11 AM

thanks for the info!

quantum-x 10-25-2007 06:06 AM

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.


All times are GMT -7. The time now is 08:07 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc