|
|
|
||||
|
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 |
|
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 |
|
|
|
|
|
#2 |
|
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 |
|
|
|
|
|
#3 |
|
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> |
|
|
|
|
|
#4 |
|
Confirmed User
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 |
|
|
|
|
|
#5 |
|
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 |
|
|
|
|
|
#6 | |
|
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:
|
|
|
|
|
|
|
#7 | |
|
Confirmed User
Join Date: Oct 2002
Location: European Union
Posts: 1,752
|
Quote:
|
|
|
|
|
|
|
#8 |
|
Confirmed User
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 |
|
|
|
|
|
#9 | |
|
Confirmed User
Join Date: Jul 2002
Location: I Love Ixtapa, Mexico ö
Posts: 616
|
Quote:
PHP Code:
PHP Code:
Rory |
|
|
|
|
|
|
#10 | |
|
Confirmed User
Join Date: Jul 2002
Location: I Love Ixtapa, Mexico ö
Posts: 616
|
Quote:
Rory |
|
|
|
|
|
|
#11 | |
|
See sig. Join Epic Cash.
Join Date: Oct 2002
Location: Montreal, Quebec. ICQ: 214702014
Posts: 22,366
|
Quote:
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 |
|
|
|
|
|
|
#12 |
|
Confirmed User
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 |
|
|
|