Computer Webmaster Gaming Console Graphics Forum

Welcome to the Computer Webmaster Gaming Console Graphics 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 contact us.

MK PitStop Main Earn $25 Earn Money Posting Extras Members Blogs Image Hosting User Pages
Go Back   Computer Webmaster Gaming Console Graphics Forum > Webmaster Forum > Website Coding > PHP
Register FAQ/Rules Become A V.I.P. Member Search Today's Posts Mark Forums Read

PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help.

Google
Reply
 
LinkBack Thread Tools Display Modes
Old 05-20-2007, 5:33 PM   #1
Kentor
 
Kentor's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default suggestion needed

Hello,

Is there a way to have a rewrite done for two files for the same path?
like this:

RewriteRule ^area/(.*) indexMap1.php?area=$1 [L,QSA]
RewriteRule ^area/(.*) indexMapContents1.php?area=$1 [L,QSA]

Your probably thinking "why would you wanna do that?"

The reason why I want to do this is because indexMap1.php is accessed
with a subdomain as following: http://something.mywebsite.com ....
something goes into some var already before these 2 rewrite rules this
way:

RewriteCond %{HTTP_HOST} ^(www\.)?([^.]+)\.mywebsite\.com
RewriteCond %{HTTP_HOST} !^www\.mywebsite\.com
RewriteRule ^$ indexMap1.php?location=%2 [L,QSA]

now, inside my indexMap1.php file I'm using indexMapContents1.php as a
javascript like this:

echo "<script type=\"text/javascript\" src=\"/indexMapContents1.php
\"></script>";

and then inside that file I tell it that its actually a JS file and
not a php...

so I need the rewrite to catch http://something.mywebsite.com/area/"this_part_here"
from the indexMapContents1.php file but I also need that same part
used in the indexMap1.php file...

Any suggestions on how I could do this would really help. I've already
spent so much time on this and the only alternative I found was to
create a cookie in indexMap1.php and get it back in
indexMapContents1.php

Thanks

 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Advertisements
Old 05-20-2007, 5:33 PM   #2
shimmyshack
 
shimmyshack's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default suggestion needed

On May 9, 2:30 am, Kentor <ken...@gmail.com> wrote:
> Hello,
>
> Is there a way to have a rewrite done for two files for the same path?
> like this:
>
> RewriteRule ^area/(.*) indexMap1.php?area=$1 [L,QSA]
> RewriteRule ^area/(.*) indexMapContents1.php?area=$1 [L,QSA]
>
> Your probably thinking "why would you wanna do that?"
>
> The reason why I want to do this is because indexMap1.php is accessed
> with a subdomain as following:http://something.mywebsite.com....
> something goes into some var already before these 2 rewrite rules this
> way:
>
> RewriteCond %{HTTP_HOST} ^(www\.)?([^.]+)\.mywebsite\.com
> RewriteCond %{HTTP_HOST} !^www\.mywebsite\.com
> RewriteRule ^$ indexMap1.php?location=%2 [L,QSA]
>
> now, inside my indexMap1.php file I'm using indexMapContents1.php as a
> javascript like this:
>
> echo "<script type=\"text/javascript\" src=\"/indexMapContents1.php
> \"></script>";
>
> and then inside that file I tell it that its actually a JS file and
> not a php...
>
> so I need the rewrite to catchhttp://something.mywebsite.com/area/"this_part_here"
> from the indexMapContents1.php file but I also need that same part
> used in the indexMap1.php file...
>
> Any suggestions on how I could do this would really help. I've already
> spent so much time on this and the only alternative I found was to
> create a cookie in indexMap1.php and get it back in
> indexMapContents1.php
>
> Thanks


http://something.mywebsite.com/area/region_name
-->
indexMap1.php?location=region_name

inside indexMap?location=region_name
-------8<-----
$location = filtered($_GET['location']);
#where filtered is a function which makes sure that the location is
checked against allowed values, and that it does not contain html, and
that it is urlencoded.
echo '<script
type="text/javascript"
src="/indexMapContents1.php?area='.$location.'">
</script>';
--------------------------

this would produce markup like so
<script type="text/javascript" src="/indexMapContents1.php?
area=region_name"></script>

inside indexMapContents1.php
---------------8<--------------
$location = filtered($_GET['location']);
//use $location as normal
--------------------------------

 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 05-20-2007, 5:33 PM   #3
Kentor
 
Kentor's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default suggestion needed

On May 9, 7:12 am, shimmyshack <matt.fa...@gmail.com> wrote:
> On May 9, 2:30 am, Kentor <ken...@gmail.com> wrote:
>
>
>
> > Hello,

>
> > Is there a way to have a rewrite done for two files for the same path?
> > like this:

>
> > RewriteRule ^area/(.*) indexMap1.php?area=$1 [L,QSA]
> > RewriteRule ^area/(.*) indexMapContents1.php?area=$1 [L,QSA]

>
> > Your probably thinking "why would you wanna do that?"

>
> > The reason why I want to do this is because indexMap1.php is accessed
> > with a subdomain as following:http://something.mywebsite.com....
> > something goes into some var already before these 2 rewrite rules this
> > way:

>
> > RewriteCond %{HTTP_HOST} ^(www\.)?([^.]+)\.mywebsite\.com
> > RewriteCond %{HTTP_HOST} !^www\.mywebsite\.com
> > RewriteRule ^$ indexMap1.php?location=%2 [L,QSA]

>
> > now, inside my indexMap1.php file I'm using indexMapContents1.php as a
> > javascript like this:

>
> > echo "<script type=\"text/javascript\" src=\"/indexMapContents1.php
> > \"></script>";

>
> > and then inside that file I tell it that its actually a JS file and
> > not a php...

>
> > so I need the rewrite to catchhttp://something.mywebsite.com/area/"this_part_here"
> > from the indexMapContents1.php file but I also need that same part
> > used in the indexMap1.php file...

>
> > Any suggestions on how I could do this would really help. I've already
> > spent so much time on this and the only alternative I found was to
> > create a cookie in indexMap1.php and get it back in
> > indexMapContents1.php

>
> > Thanks

>
> http://something.mywebsite.com/area/region_name
> -->
> indexMap1.php?location=region_name
>
> inside indexMap?location=region_name
> -------8<-----
> $location = filtered($_GET['location']);
> #where filtered is a function which makes sure that the location is
> checked against allowed values, and that it does not contain html, and
> that it is urlencoded.
> echo '<script
> type="text/javascript"
> src="/indexMapContents1.php?area='.$location.'">
> </script>';
> --------------------------
>
> this would produce markup like so
> <script type="text/javascript" src="/indexMapContents1.php?
> area=region_name"></script>
>
> inside indexMapContents1.php
> ---------------8<--------------
> $location = filtered($_GET['location']);
> //use $location as normal
> --------------------------------


Awsome that worked thanks a lot.

 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 05-20-2007, 5:33 PM   #4
shimmyshack
 
shimmyshack's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default suggestion needed

On May 9, 12:50 pm, Kentor <ken...@gmail.com> wrote:
> On May 9, 7:12 am, shimmyshack <matt.fa...@gmail.com> wrote:
>
>
>
> > On May 9, 2:30 am, Kentor <ken...@gmail.com> wrote:

>
> > > Hello,

>
> > > Is there a way to have a rewrite done for two files for the same path?
> > > like this:

>
> > > RewriteRule ^area/(.*) indexMap1.php?area=$1 [L,QSA]
> > > RewriteRule ^area/(.*) indexMapContents1.php?area=$1 [L,QSA]

>
> > > Your probably thinking "why would you wanna do that?"

>
> > > The reason why I want to do this is because indexMap1.php is accessed
> > > with a subdomain as following:http://something.mywebsite.com....
> > > something goes into some var already before these 2 rewrite rules this
> > > way:

>
> > > RewriteCond %{HTTP_HOST} ^(www\.)?([^.]+)\.mywebsite\.com
> > > RewriteCond %{HTTP_HOST} !^www\.mywebsite\.com
> > > RewriteRule ^$ indexMap1.php?location=%2 [L,QSA]

>
> > > now, inside my indexMap1.php file I'm using indexMapContents1.php as a
> > > javascript like this:

>
> > > echo "<script type=\"text/javascript\" src=\"/indexMapContents1.php
> > > \"></script>";

>
> > > and then inside that file I tell it that its actually a JS file and
> > > not a php...

>
> > > so I need the rewrite to catchhttp://something.mywebsite.com/area/"this_part_here"
> > > from the indexMapContents1.php file but I also need that same part
> > > used in the indexMap1.php file...

>
> > > Any suggestions on how I could do this would really help. I've already
> > > spent so much time on this and the only alternative I found was to
> > > create a cookie in indexMap1.php and get it back in
> > > indexMapContents1.php

>
> > > Thanks

>
> >http://something.mywebsite.com/area/region_name
> > -->
> > indexMap1.php?location=region_name

>
> > inside indexMap?location=region_name
> > -------8<-----
> > $location = filtered($_GET['location']);
> > #where filtered is a function which makes sure that the location is
> > checked against allowed values, and that it does not contain html, and
> > that it is urlencoded.
> > echo '<script
> > type="text/javascript"
> > src="/indexMapContents1.php?area='.$location.'">
> > </script>';
> > --------------------------

>
> > this would produce markup like so
> > <script type="text/javascript" src="/indexMapContents1.php?
> > area=region_name"></script>

>
> > inside indexMapContents1.php
> > ---------------8<--------------
> > $location = filtered($_GET['location']);
> > //use $location as normal
> > --------------------------------

>
> Awsome that worked thanks a lot.


sorry for the type it should have been
src="/indexMapContents1.php?location='.$location.'">
of course, but I got confused!

 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 05-20-2007, 5:33 PM   #5
Kentor
 
Kentor's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default suggestion needed

On May 9, 8:11 am, shimmyshack <matt.fa...@gmail.com> wrote:
> On May 9, 12:50 pm, Kentor <ken...@gmail.com> wrote:
>
>
>
> > On May 9, 7:12 am, shimmyshack <matt.fa...@gmail.com> wrote:

>
> > > On May 9, 2:30 am, Kentor <ken...@gmail.com> wrote:

>
> > > > Hello,

>
> > > > Is there a way to have a rewrite done for two files for the same path?
> > > > like this:

>
> > > > RewriteRule ^area/(.*) indexMap1.php?area=$1 [L,QSA]
> > > > RewriteRule ^area/(.*) indexMapContents1.php?area=$1 [L,QSA]

>
> > > > Your probably thinking "why would you wanna do that?"

>
> > > > The reason why I want to do this is because indexMap1.php is accessed
> > > > with a subdomain as following:http://something.mywebsite.com....
> > > > something goes into some var already before these 2 rewrite rules this
> > > > way:

>
> > > > RewriteCond %{HTTP_HOST} ^(www\.)?([^.]+)\.mywebsite\.com
> > > > RewriteCond %{HTTP_HOST} !^www\.mywebsite\.com
> > > > RewriteRule ^$ indexMap1.php?location=%2 [L,QSA]

>
> > > > now, inside my indexMap1.php file I'm using indexMapContents1.php as a
> > > > javascript like this:

>
> > > > echo "<script type=\"text/javascript\" src=\"/indexMapContents1.php
> > > > \"></script>";

>
> > > > and then inside that file I tell it that its actually a JS file and
> > > > not a php...

>
> > > > so I need the rewrite to catchhttp://something.mywebsite.com/area/"this_part_here"
> > > > from the indexMapContents1.php file but I also need that same part
> > > > used in the indexMap1.php file...

>
> > > > Any suggestions on how I could do this would really help. I've already
> > > > spent so much time on this and the only alternative I found was to
> > > > create a cookie in indexMap1.php and get it back in
> > > > indexMapContents1.php

>
> > > > Thanks

>
> > >http://something.mywebsite.com/area/region_name
> > > -->
> > > indexMap1.php?location=region_name

>
> > > inside indexMap?location=region_name
> > > -------8<-----
> > > $location = filtered($_GET['location']);
> > > #where filtered is a function which makes sure that the location is
> > > checked against allowed values, and that it does not contain html, and
> > > that it is urlencoded.
> > > echo '<script
> > > type="text/javascript"
> > > src="/indexMapContents1.php?area='.$location.'">
> > > </script>';
> > > --------------------------

>
> > > this would produce markup like so
> > > <script type="text/javascript" src="/indexMapContents1.php?
> > > area=region_name"></script>

>
> > > inside indexMapContents1.php
> > > ---------------8<--------------
> > > $location = filtered($_GET['location']);
> > > //use $location as normal
> > > --------------------------------

>
> > Awsome that worked thanks a lot.

>
> sorry for the type it should have been
> src="/indexMapContents1.php?location='.$location.'">
> of course, but I got confused!


Yea you almost got it right the first time... I just needed this part:
src="/indexMapContents1.php?area=whatever"... I didn't know I could do
that. Thanks again

 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Featured Websites
Free Space
Free Space
Free Space Free Space
Reply
Tags: ,




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Your opinion needed on a purchase keegan99k9 Article Marketing 2 02-08-2007 3:36 AM
Training suggestion Matt7791 The Games 16 11-08-2006 3:03 PM
Mad Max - Suggestion - |m.k|matt - Read Plz Matt7791 The Games 17 10-22-2006 9:59 AM
Suggestion => Download Board Mattster Bugs And Feedback 1 04-03-2006 2:04 PM


Featured Websites




All times are GMT +1. The time now is 1:13 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Cheap Computers
MK PitStop Copyright 2005 - 2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98