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 Mark Forums Read
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 12-05-2002, 11:31 PM   #1
psyko514
See sig. Join Epic Cash.
 
Join Date: Oct 2002
Location: Montreal, Quebec. ICQ: 214702014
Posts: 22,366
Passing variables from PHP to Javascript and vice versa

i have a frames page with a menubar at top and the main content below. i want the main page to redirect to a PHP page based on screen size using the following format

if (screen.width > 1024)
{window.location.href='girls1024.php?id=XXXXX'}

where XXXXX will be sent to JS from PHP

i know very little about JS, so help me out here... thanks
psyko514 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2002, 11:32 PM   #2
Exxxotica
Confirmed User
 
Join Date: Jan 2001
Location: Oregun
Posts: 4,396
uhh....
__________________


Needs some really great hosting? Black Seven

note: I do not work for Blackseven... Im just grateful for their kick ass hosting...so quit bothering them when I hurt your feelings... pussy
Exxxotica is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2002, 11:38 PM   #3
FATPad
Confirmed User
 
Join Date: Oct 2001
Posts: 6,693
Your main page has to set those values. They'll be part of the html document that is sent to the browser. Since it sounds like the main page will be dynamic in nature, whatever you use to build the main page should just fill that information in as part of the html document.
__________________
<a href="http://www.adultcontent.co.uk">Adult Content UK - Great British Content</a>
FATPad is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2002, 11:42 PM   #4
magnatique
Confirmed User
 
magnatique's Avatar
 
Join Date: Jan 2001
Location: Montreal
Posts: 1,830
(for this message, whenever I put "*", replace it by a "?" ... I can't write it the right way, else it treats it as php)

ok assuming your page you are linking to is called

www.domain.com/redir.php

you'd link to it like

www.domain.com/redir.php?id=magnatique

then, on that redir.php page you'd have

if (screen.width >= 1024)
{window.location.href='girls1024.php?id=<* echo $id;*>'}
else if (screen.width >= 800)
{window.location.href='girls800.php?id=<* echo $id;*>'}
else
{window.location.href='girls640.php?id=<* echo $id;*>'}
__________________

Stunner Media Programs: StandAhead | IndieBucks | BoyCrushCash | Phoenixxx | EmoProfits | BritishBucks | HunkMoney | LatinoBucks
Make $$$ with Gay! Lowest Minimum Payouts in the Business, Perfect Track Record, Amazing Sites

Last edited by magnatique; 12-05-2002 at 11:47 PM..
magnatique is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-06-2002, 12:00 AM   #5
Exxxotica
Confirmed User
 
Join Date: Jan 2001
Location: Oregun
Posts: 4,396
uhh...
__________________


Needs some really great hosting? Black Seven

note: I do not work for Blackseven... Im just grateful for their kick ass hosting...so quit bothering them when I hurt your feelings... pussy
Exxxotica is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-06-2002, 01:23 AM   #6
psyko514
See sig. Join Epic Cash.
 
Join Date: Oct 2002
Location: Montreal, Quebec. ICQ: 214702014
Posts: 22,366
i tried that and it didn't work... as far as i know (and correct me if i'm wrong) you can't imbed one script in another.

Quote:
Originally posted by magnatique
(for this message, whenever I put "*", replace it by a "?" ... I can't write it the right way, else it treats it as php)

ok assuming your page you are linking to is called

www.domain.com/redir.php

you'd link to it like

www.domain.com/redir.php?id=magnatique

then, on that redir.php page you'd have

if (screen.width >= 1024)
{window.location.href='girls1024.php?id=<* echo $id;*>'}
else if (screen.width >= 800)
{window.location.href='girls800.php?id=<* echo $id;*>'}
else
{window.location.href='girls640.php?id=<* echo $id;*>'}
psyko514 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-06-2002, 07:11 AM   #7
Calvinguy
Confirmed User
 
Join Date: Oct 2002
Location: European Union
Posts: 1,752
Quote:
Originally posted by psyko514
i tried that and it didn't work... as far as i know (and correct me if i'm wrong) you can't imbed one script in another.

Of course you can... JS is client based, PHP server based
Calvinguy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-06-2002, 11:42 AM   #8
magnatique
Confirmed User
 
magnatique's Avatar
 
Join Date: Jan 2001
Location: Montreal
Posts: 1,830
php has to be enabled on the server ;)

also, as I said, replace the * by ?


whatever you put in a url like
?id=test

you call it back ('test')
by writing
<* echo $id;*>

where the * is a ?
__________________

Stunner Media Programs: StandAhead | IndieBucks | BoyCrushCash | Phoenixxx | EmoProfits | BritishBucks | HunkMoney | LatinoBucks
Make $$$ with Gay! Lowest Minimum Payouts in the Business, Perfect Track Record, Amazing Sites
magnatique is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-06-2002, 11:48 AM   #9
Rory
Confirmed User
 
Join Date: Jul 2002
Location: I Love Ixtapa, Mexico ö
Posts: 616
Quote:
Originally posted by magnatique
php has to be enabled on the server ;)

also, as I said, replace the * by ?


whatever you put in a url like
?id=test

you call it back ('test')
by writing
<* echo $id;*>

where the * is a ?
Register Globals = not only horrible coding habit, but now off by default in later versions of PHP (thank god).

PHP Code:
<?php
$id 
$_GET['id'];
echo 
"$id";
or on one line :

PHP Code:
<?php $id $_GET['id'];echo "$id";?>
Just trying to get rid of bad habits before they start growing on newbies.

Rory
Rory is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-06-2002, 11:52 AM   #10
Rory
Confirmed User
 
Join Date: Jul 2002
Location: I Love Ixtapa, Mexico ö
Posts: 616
Quote:
Originally posted by psyko514
i tried that and it didn't work... as far as i know (and correct me if i'm wrong) you can't imbed one script in another.

Jesus you are a fuckin mess man. Try and explain what you are doing a bit beter and I will try and help. What is id and where is it acquired. If its a JS variable you will need to do .......?id="+id+" (or whatever you called the javascript variable). I have no clue really though what you are trying to accomplish.

Rory
Rory is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-06-2002, 11:38 PM   #11
psyko514
See sig. Join Epic Cash.
 
Join Date: Oct 2002
Location: Montreal, Quebec. ICQ: 214702014
Posts: 22,366
Quote:
Originally posted by magnatique
php has to be enabled on the server ;)

also, as I said, replace the * by ?


whatever you put in a url like
?id=test

you call it back ('test')
by writing
<* echo $id;*>

where the * is a ?
number one, php is enabled by the server.
number two, i had originally tried it in the format you suggested, and that didn't work, so that's why i came here.
you're 100% right about java being client-side and php being server-side... i thought it would work, but it didn't

as for your comment rory, i'm a "newb" when it comes to javascript... not when it comes to php/c++

i'll attempt to explain my objective a bit better. i have a frames page, the top frame being a menu bar controlling the main frame.
the surfer will fill out a form in the main frame and id is a unique ID assigned to them when they sign up for my site. it's the primary key of a mysql table.
when the login, a script retrieves their info from the table, and ID gets plugged into a hidden form element.
when they fill out the form and submit it, the form gets processed and they're brought to the javascript redirect page which redirects them based on their screen size, giving them a unique page based on their screen size and ID

-------------------------------------------------
it's all moot because i've solved the problem
but thanks anyways
psyko514 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-07-2002, 09:51 PM   #12
magnatique
Confirmed User
 
magnatique's Avatar
 
Join Date: Jan 2001
Location: Montreal
Posts: 1,830
am a php newb myself, trying to learn it hehe..

thanks for the heads up rory, will code this way from now on ;)
__________________

Stunner Media Programs: StandAhead | IndieBucks | BoyCrushCash | Phoenixxx | EmoProfits | BritishBucks | HunkMoney | LatinoBucks
Make $$$ with Gay! Lowest Minimum Payouts in the Business, Perfect Track Record, Amazing Sites
magnatique 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
Thread Tools



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.