Become a part of the TranceAddict community!Frequently Asked Questions - Please read this if you haven'tSearch the forums
TranceAddict Forums > Main Forums > Chill Out Room > Need some help with PHP
  Last Thread   Next Thread
Share
Author
Thread    Post A Reply
nekholm
nekholm



Registered: Jan 2001
Location: .fi
Need some help with PHP

I'm making some kinda personal page with PHP, and there's one thing I don't know how to do. It should be really simple, but I just can't figure out how to do it..

The thing is, I use include("$view.php"); => nek.php?view=whatever, and if someone goes to mypage/whatever.php, I want it to forward/redirect the visitor to mypage/nek.php?view=whatever.

I tried it with javascript (if (top.location.href != nek.php?view=test ) top.location.href = nek.php?view=test). It didn't work tho, it kept refreshing the page over and over again. But it almost worked So it could be done in a quite similar way I guess.

Anyone with ideas on how to make this work with either PHP or javascript?


___________________

Old Post Nov-18-2003 09:46  Finland
Click Here to See the Profile for nekholm Click here to Send nekholm a Private Message Visit nekholm's homepage! Add nekholm to your buddy list Report this Post Reply w/Quote Edit/Delete Message
nekholm
nekholm



Registered: Jan 2001
Location: .fi

Noone with any ideas?


___________________

Old Post Dec-03-2003 12:10  Finland
Click Here to See the Profile for nekholm Click here to Send nekholm a Private Message Visit nekholm's homepage! Add nekholm to your buddy list Report this Post Reply w/Quote Edit/Delete Message
Rostros
Carbon Sasquatch



Registered: Dec 2001
Location: United Kingdom

I dont think it is possible to run a Javascript in a php script, i maybe wrong i know i had problems when i used js with php, i would look at php dev sites and on google too.


___________________

" You bet your ass we're all alike... we've been spoon-fed baby food at school when we hungered for steak... the bits of meat that you did let slip
through were pre-chewed and tasteless. We've been dominated by sadists, or ignored by the apathetic. The few that had something to teach found us will-
ing pupils, but those few are like drops of water in the desert."

Old Post Dec-03-2003 12:34  United Kingdom
Click Here to See the Profile for Rostros Click here to Send Rostros a Private Message Add Rostros to your buddy list Report this Post Reply w/Quote Edit/Delete Message
Rostros
Carbon Sasquatch



Registered: Dec 2001
Location: United Kingdom

I dont think it is possible to run a Javascript in a php script, i maybe wrong i know i had problems when i used js with php, i would look at php dev sites and on google too.


___________________

" You bet your ass we're all alike... we've been spoon-fed baby food at school when we hungered for steak... the bits of meat that you did let slip
through were pre-chewed and tasteless. We've been dominated by sadists, or ignored by the apathetic. The few that had something to teach found us will-
ing pupils, but those few are like drops of water in the desert."

Old Post Dec-03-2003 12:34  United Kingdom
Click Here to See the Profile for Rostros Click here to Send Rostros a Private Message Add Rostros to your buddy list Report this Post Reply w/Quote Edit/Delete Message
Rostros
Carbon Sasquatch



Registered: Dec 2001
Location: United Kingdom

quote:
Originally posted by Rostros
I dont think it is possible to run a Javascript in a php script, i maybe wrong i know i had problems when i used js with php, i would look at php dev sites and on google too.


wtf it posted it twice , wierd


___________________

" You bet your ass we're all alike... we've been spoon-fed baby food at school when we hungered for steak... the bits of meat that you did let slip
through were pre-chewed and tasteless. We've been dominated by sadists, or ignored by the apathetic. The few that had something to teach found us will-
ing pupils, but those few are like drops of water in the desert."

Old Post Dec-03-2003 12:35  United Kingdom
Click Here to See the Profile for Rostros Click here to Send Rostros a Private Message Add Rostros to your buddy list Report this Post Reply w/Quote Edit/Delete Message
loconet
de la puta madre!



Registered: Jul 2002
Location: San Francisco

in whatever.php, assuming theres no ouput b4..

code:
$fname = basename($_SERVER['PHP_SELF']); $view = substr($fname,0,strpos($fname,".")); header("Location: mypage/nek.php?view=$view");


___________________
[alk]

Old Post Dec-03-2003 13:35  Peru
Click Here to See the Profile for loconet Click here to Send loconet a Private Message Visit loconet's homepage! Add loconet to your buddy list Report this Post Reply w/Quote Edit/Delete Message
Mr Game+Watch
Luka Luka * Night Fever



Registered: Nov 2002
Location: Long Island, NY

Not sure of the PHP implementation (I'm a ColdFusion programmer myself)... but can you have a page that extracts the URL paramater (in this case "view"), and then $include(URL Paramater) dynamically... You shouldn't even need to worry about javascript.


___________________
9-9-99 Never Forget

Quarantine Music Festival 2020

All My Mixes!

Old Post Dec-03-2003 15:11  United States
Click Here to See the Profile for Mr Game+Watch Click here to Send Mr Game+Watch a Private Message Visit Mr Game+Watch's homepage! Add Mr Game+Watch to your buddy list Report this Post Reply w/Quote Edit/Delete Message
nekholm
nekholm



Registered: Jan 2001
Location: .fi

quote:
Originally posted by DJ RozzeR
I dont think it is possible to run a Javascript in a php script, i maybe wrong i know i had problems when i used js with php, i would look at php dev sites and on google too.


Maybe not, I don't know. I've tried to search, but the problem is I don't really know what to search for..

quote:
Originally posted by DJ RozzeR
wtf it posted it twice , wierd


And instead of edit the second post, you post a third time

quote:
Originally posted by loconet
in whatever.php, assuming theres no ouput b4..

code:
$fname = basename($_SERVER['PHP_SELF']); $view = substr($fname,0,strpos($fname,".")); header("Location: mypage/nek.php?view=$view");


Inside I assume? What else, I tried it but it didn't work..

quote:
Originally posted by Mr Game+Watch
Not sure of the PHP implementation (I'm a ColdFusion programmer myself)... but can you have a page that extracts the URL paramater (in this case "view"), and then $include(URL Paramater) dynamically... You shouldn't even need to worry about javascript.


Did I mention I'm quite new to PHP, I only know some very simple stuff? In other words, I have no idea how that would work..


___________________

Old Post Dec-03-2003 17:15  Finland
Click Here to See the Profile for nekholm Click here to Send nekholm a Private Message Visit nekholm's homepage! Add nekholm to your buddy list Report this Post Reply w/Quote Edit/Delete Message
loconet
de la puta madre!



Registered: Jul 2002
Location: San Francisco

quote:
Originally posted by nekholm


Inside I assume? What else, I tried it but it didn't work..



Yes inside .

I tested having test.php as:

code:



it redirects to /index.php as:
/index.php?view=test

do you get an error message?


___________________
[alk]

Old Post Dec-03-2003 17:34  Peru
Click Here to See the Profile for loconet Click here to Send loconet a Private Message Visit loconet's homepage! Add loconet to your buddy list Report this Post Reply w/Quote Edit/Delete Message
nekholm
nekholm



Registered: Jan 2001
Location: .fi

That actually works I tested it, but I used $p instead of $view on another page, so I just forgot to change $view to $p. But yes it works. Thanx alot


___________________

Old Post Dec-03-2003 18:38  Finland
Click Here to See the Profile for nekholm Click here to Send nekholm a Private Message Visit nekholm's homepage! Add nekholm to your buddy list Report this Post Reply w/Quote Edit/Delete Message

TranceAddict Forums > Main Forums > Chill Out Room > Need some help with PHP
Post New Thread    Post A Reply

 
Last Thread   Next Thread
Click here to listen to the sample!Pause playbacktune from pascal feos set [2003] [0]

Click here to listen to the sample!Pause playbackSubstructure - "Readers Waves Pt. 1" [2003]

Show Printable Version | Subscribe to this Thread
Forum Jump:

All times are GMT. The time now is 17:39.

Forum Rules:
You may not post new threads
You may not post replies
You may not edit your posts
HTML code is ON
vB code is ON
[IMG] code is ON
 
Search this Thread:

 
Contact Us - return to tranceaddict

Powered by: Trance Music & vBulletin Forums
Copyright ©2000-2026, Jelsoft Enterprises Ltd.
Privacy Statement / DMCA
Support TA!