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)
-   -   PROGRAMMERS: Nested PHP variables? (https://gfy.com/showthread.php?t=108444)

MonkeyMan 02-15-2003 05:28 AM

PROGRAMMERS: Nested PHP variables?
 
Ok using gallery spots I have run into a snag
they use PHP for thier gallery links with 2 variables.

My TGP scripts also use multiple PHP variables.


Using links like this

outscript.php?varA=80&varB=10&url=http://babes.spotbrokers.com/gallery.php?snid=58&linkid=pop-14

does not work becasue it only appears to be sending the first variable to the gallery script and the second seems to only go the tgp out script.

is there a way I can nest 2 PHP urls that use multiple variables?
(outscript.php?var=80&var=1&url=)(gallery.php?snid =58&linkid=pop-14)

Many thanks if somone could enlighten me. :(



:Graucho

Voodoo 02-15-2003 05:31 AM

What are the two variable names?

MonkeyMan 02-15-2003 05:33 AM

Quote:

Originally posted by Voodoo
What are the two variable names?
what bearing does that have? They are in my qestion.


var=

snid=
linkid=

grumpy 02-15-2003 05:34 AM

outscript.php?var=80&var=1&url=http://babes.spotbrokers.com/gallery.php?snid=58&linkid=pop-14


var=80
var=1

You have two vars with the same name, tray to put the url in ' ' it has a questionmark in it

MonkeyMan 02-15-2003 05:35 AM

Quote:

Originally posted by grumpy
outscript.php?var=80&var=1&url=http://babes.spotbrokers.com/gallery.php?snid=58&linkid=pop-14


var=80
var=1

You have two vars with the same name, tray to put the url in ' ' it has a questionmark in it

Yes I know I jsut typed it fast and i already tried ' '



outscript.php?var=80&url='http://babes.spotbrokers.com/gallery.php?snid=58&linkid=pop-14'


doesnt work

Libertine 02-15-2003 05:38 AM

you can do it like this:

firsturl.php?avar=2&bvar=3&url=http://www.blegh.com/script.php?ohio:kansas

then just explode() the querystring on : on the second url. make sure you check the variables for validity/security though.

grumpy 02-15-2003 05:39 AM

try this
outscript.php?var=80&var=1&url='gallery.php?snid=5 8&linkid=pop-14'

MonkeyMan 02-15-2003 05:42 AM

Quote:

Originally posted by punkworld
you can do it like this:

firsturl.php?avar=2&bvar=3&url=http://www.blegh.com/script.php?ohio:kansas

then just explode() the querystring on : on the second url. make sure you check the variables for validity/security though.

Could you give me a full example??? I'm no good with PHP I dont really understand how to do what your saying.


Quote:

Originally posted by grumpy
try this
outscript.php?var=80&var=1&url='gallery.php?snid=5 8&linkid=pop-14'

Cant...
The surfer is going through my out link then to Galleyspots scipt on thier server. Its not my PHP script outscript.php is in my root but the other is not.

Voodoo 02-15-2003 05:43 AM

Quote:

Originally posted by MonkeyMan
what bearing does that have? They are in my qestion.


var=

snid=
linkid=

It has every bearing, as you didn't type them correctly in your question. :ak47:

MonkeyMan 02-15-2003 05:44 AM

Quote:

Originally posted by Voodoo


It has every bearing, as you didn't type them correctly in your question. :ak47:

heh Dude... Im not dumb.. I wouldn't ask the question if I hadn't double checked spelling.

Voodoo 02-15-2003 05:46 AM

Quote:

Originally posted by MonkeyMan
heh Dude... Im not dumb.. I wouldn't ask the question if I hadn't double checked spelling.

What does the following code do?
What is the purpose of the first var declaration?

var=80&var=1

MonkeyMan 02-15-2003 05:47 AM

Quote:

Originally posted by Voodoo



What does the following code do?
What is the purpose of the first var declaration?

var=80&var=1

OK your obviously not the one to help me so please just stop.... that has no bearing on my problem.

Is the variables in the SECOND url athat are not goign through.

Voodoo 02-15-2003 05:48 AM

Quote:

Originally posted by MonkeyMan
OK your obviously not the one to help me so please just stop.... that has no bearing on my problem.
:1orglaugh Ok dude. It seems like the URL string that you posted has a few problems... but, I'll let you work it out for yourself then.

:321GFY

MonkeyMan 02-15-2003 05:52 AM

Quote:

Originally posted by Voodoo


:1orglaugh Ok dude. It seems like the URL string that you posted has a few problems... but, I'll let you work it out for yourself then.

:321GFY

ITS A CONCEPT... nested variables has nothign to do with the specific string I put forth. That was jsut an example.

blah.php?varA=1&varB=2&url=bling.php?varA=1&varB=2

would STILL explain my qestion

varB is not getting parsed by bling.php

its abstract, it doesnt matter if my urls are correct or even real; its the concept of the code.

Libertine 02-15-2003 05:56 AM

Quote:

Originally posted by MonkeyMan


...

Sample code:


$testvar = $_SERVER['QUERY_STRING'];
$quervar = explode(":", "$testvar");
$varcount = count($quervar);
for($i=0;$i<$varcount;$i++){
echo($quervar[$i] . "\n");
}

Libertine 02-15-2003 05:59 AM

The code I just gave you gets the querystring, chops it up into an array, and displays each piece on a new line. That should help you on your way.

mrreuben 02-15-2003 06:03 AM

Simple solution:

replace the ampersands in the 2nd url with % 2 6 (no spaces in the symbol. This turns the url into 1 long string. Then call your outscript as normal. Most tradescripts will then not choke on the extra symbols.

If you have a custom script you must call the urldecode() php function in your internal code on the url before sending out the hit. This puts the url back together for the browser.

example

outscript.php
var=80&var=1&url=http://babes.spotbrokers.com/gallery.php?snid=58%26linkid=pop-14


hope this helps

MonkeyMan 02-15-2003 06:07 AM

Quote:

Originally posted by mrreuben
Simple solution:

replace the ampersands in the 2nd url with % 2 6 (no spaces in the symbol. This turns the url into 1 long string. Then call your outscript as normal. Most tradescripts will then not choke on the extra symbols.

If you have a custom script you must call the urldecode() php function in your internal code on the url before sending out the hit. This puts the url back together for the browser.

example

outscript.php
var=80&var=1&url=http://babes.spotbrokers.com/gallery.php?snid=58%26linkid=pop-14


hope this helps


so If i replace this

$url = header_check($url);
with
$url = urldecode(header_check($url));

in my outscript.php
that should do it???

MonkeyMan 02-15-2003 06:20 AM

Blah, it doesnt work becasue thers is a hahahahahahahahahaha involved that is converting the %26 when it generates the page.


can somone tell me how to do a simple character replacment?

like take a string and convert all the "|"'s in the string to "&"s using PHP

I think that would be the simplest way, but I dont know how to do it.

mrreuben 02-15-2003 06:21 AM

Quote:

Originally posted by MonkeyMan



so If i replace this

$url = header_check($url);
with
$url = urldecode(header_check($url));

in my outscript.php
that should do it???

Basically yes.

Php automaticly passes the variables from a querystring or a HTTP POST into your script as is you should not need to call header_check(). Unless you redefine it.

Just make sure the url in your html pages you change out the ampersands in the 2nd url. This will ensure that $url is passed as 1 long string.

Libertine 02-15-2003 06:21 AM

Quote:

Originally posted by MonkeyMan
...
Dude, you aren't in charge of the page which hits are sent to, but in charge of the one from which the hits are sent?

Doh! Shoulda looked better :)

(oh, and what you should do now depends on what that header_check function does)

MonkeyMan 02-15-2003 06:24 AM

Quote:

Originally posted by mrreuben


Basically yes.

Php automaticly passes the variables from a querystring or a HTTP POST into your script as is you should not need to call header_check(). Unless you redefine it.

Just make sure the url in your html pages you change out the ampersands in the 2nd url. This will ensure that $url is passed as 1 long string.

yea but I already ruled out this method... my pages use java as well an that does the conversion when generating the page. Sorry I failed to mention the URLS are being generated using java.

hahah it jsut keeps getting deeper and deeper but I think jsut using some kinda simple char replacment code would be my best bet.

Quote:

Originally posted by punkworld


Dude, you aren't in charge of the page which hits are sent to, but in charge of the one from which the hits are sent?

Doh! Shoulda looked better :)

(oh, and what you should do now depends on what that header_check function does)

No, Im in chare of ourscript.php

but not the gallery.php (its on a different server)

ServerGenius 02-15-2003 06:24 AM

Quote:

Originally posted by mrreuben
Simple solution:

replace the ampersands in the 2nd url with % 2 6 (no spaces in the symbol. This turns the url into 1 long string. Then call your outscript as normal. Most tradescripts will then not choke on the extra symbols.

If you have a custom script you must call the urldecode() php function in your internal code on the url before sending out the hit. This puts the url back together for the browser.

example

outscript.php
var=80&var=1&url=http://babes.spotbrokers.com/gallery.php?snid=58%26linkid=pop-14


hope this helps

Bingo....the only correct answer....

use urlencode to translate special characters to ascii codes
and ulrdecode to translate it back....allthough your browser also
understand the ascii codes for the special characters.

DynaMite :thumbsup

JayJay 02-15-2003 06:26 AM

Wasn't it you that laughed at some poor guy who needed help yesterday?
Quote:

why dont you fucking try using google and stop expecting knowledge to be handed to you on an adult webmasters forum. its really not that difficult to figure out
:321GFY DICK HEAD

Libertine 02-15-2003 06:26 AM

Quote:

Originally posted by mrreuben


Basically yes.

Php automaticly passes the variables from a querystring or a HTTP POST into your script as is you should not need to call header_check(). Unless you redefine it.

Just make sure the url in your html pages you change out the ampersands in the 2nd url. This will ensure that $url is passed as 1 long string.

header_check is a funtion of the tradescript (I believe CJ Ultra), not a predefined php one. The problem he has actually is a very basic one, and I even wrote a patch (unofficial) for CJUltra for something of the kind a year or so ago.

MonkeyMan 02-15-2003 06:28 AM

Quote:

Originally posted by JayJay
Wasen't you that guy who laughed at someone who needed help yesterday?


:321GFY DICK HEAD

LOL!!! Jayjay I love you. :1orglaugh

mrreuben 02-15-2003 06:29 AM

Quote:

Originally posted by MonkeyMan
Blah, it doesnt work becasue thers is a hahahahahahahahahaha involved that is converting the %26 when it generates the page.


can somone tell me how to do a simple character replacment?

like take a string and convert all the "|"'s in the string to "&"s using PHP

I think that would be the simplest way, but I dont know how to do it.


If you are generating pages using php use the urlencode() function on the url as you generating the page.

If you have them hard coded use str_replace:

mixed str_replace ( mixed search, mixed replace, mixed subject)

Without disecting yourscript thats 1 way to approach it.

JayJay 02-15-2003 06:30 AM

If your going to Quote me MonkeyBoy get it right

MonkeyMan 02-15-2003 06:31 AM

Quote:

Originally posted by mrreuben



If you are generating pages using php use the urlencode() function on the url as you generating the page.

If you have them hard coded use str_replace:

mixed str_replace ( mixed search, mixed replace, mixed subject)

Without disecting yourscript thats 1 way to approach it.

Naw pages generated by j a v a s c r i p t

I wonder why the hell thats censored.

MonkeyMan 02-15-2003 06:33 AM

str_replace("|", "&", $url);


^ that would do it?? :Graucho

Libertine 02-15-2003 06:33 AM

Just use the special characters for the querystring (not for other stuff), and you don't need to do anything special at all, you can just leave it that way.

ServerGenius 02-15-2003 06:34 AM

Quote:

Originally posted by MonkeyMan
Naw pages generated by j a v a s c r i p t

I wonder why the hell thats censored.

Try using & a m p ; without spaces in the hahahahahahahahahaha for the url
part

DynaMite

JayJay 02-15-2003 06:34 AM

Stop helping this Fucking Jerk!
Quote:

I used to run a passcracker forum

MonkeyMan 02-15-2003 06:35 AM

Quote:

Originally posted by JayJay
Stop helping this Fucking Jerk!

Let it go... why dont you link to the the thread Instead of taking snippets out to suit your sad need to bash me.

JayJay 02-15-2003 06:38 AM

If you want it find it yourself

mrreuben 02-15-2003 06:39 AM

Quote:

Originally posted by MonkeyMan
Naw pages generated by j a v a s c r i p t

I wonder why the hell thats censored.


just do a search/replace using your html editor then , just single step each replacement or

cut out the urls into a blank page the s/r then paste back in.

Pain but it is the only way.

MonkeyMan 02-15-2003 06:44 AM

hmmm


$url = header_check($url);
str_replace("|", "&", $url);
header("Location: $url");


Shouldnt that work??
Im not seeing whats wrong with my code
but its not replacing the |'s

mrreuben 02-15-2003 07:00 AM

Quote:

Originally posted by MonkeyMan
hmmm


$url = header_check($url);
str_replace("|", "&", $url);
header("Location: $url");


Shouldnt that work??
Im not seeing whats wrong with my code
but its not replacing the |'s

We are on two different pages here.

Your outscript code

$url = "Location:" . urldecode($url);
header ($url);

That's it! The header_check() is not needed unless it serves to verify the url passed for some reason.


your html source

ttt-out.php?url=http://www.dollars4babes.com/mpa2/gallhit.php?w=100349%26p=2%26gall=1040389346&link= roxycarter

I took this url from my site to show you since the second url has multiple variables.

The focus of your changes is in your html source not the script code.

Try that out

Libertine 02-15-2003 07:02 AM

Quote:

Originally posted by mrreuben

That's it! The header_check() is not needed unless it serves to verify the url passed for some reason.

the header_check() is perhaps the most important function in the script, for the maker that is.

MonkeyMan 02-15-2003 07:49 AM

Thanks for the help I ended up using.

$url = header_check($url);
$url = str_replace("|", "&", $url);
header("Location: $url");

And everthings wokring great.

Mutt 02-15-2003 09:55 AM

AMP must be asleep.


Dancing Pig needed STAT!


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

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