473,395 Members | 1,583 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How do you pass a variable via a "pseudo-directory" or URL prefix?

I've searched everywhere for this but I'm not sure exactly what to
search for.

What I am trying to do is pass a variable to a php script via the URL.
However, I don't want to use the standard "?name=value format." I want
to either pass the variable as "value website.com" or
"website.com/value" where the script is stored in some directory
"website.com/script/index.php" and the value gets stored in a variable
declared within my php script.

I have seen this done but I just need some guidance on how to go about
doing it.

Thanks in advance!
I really appreciate your help :)

Oct 19 '06 #1
3 2007
On 19 Oct 2006 15:12:50 -0700, "jo*********@gmail.com" <jo*********@gmail.com>
wrote:
>I've searched everywhere for this but I'm not sure exactly what to
search for.

What I am trying to do is pass a variable to a php script via the URL.
However, I don't want to use the standard "?name=value format." I want
to either pass the variable as "value website.com" or
"website.com/value" where the script is stored in some directory
"website.com/script/index.php" and the value gets stored in a variable
declared within my php script.

I have seen this done but I just need some guidance on how to go about
doing it.
Look up "mod_rewrite" for Apache.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Oct 19 '06 #2
I've read a little bit now about mod_rewrite. So, just testing it with
a simple rule I can't get it to work... I placed the following at the
top of my .htaccess file:

RewriteEngine on
RewriteRule shortcut u/user/index.html

I am using GoDaddy and they have mod_rewrite installed and enabled by
default on all their servers. So, I know thats not the issue.

I've also tried using a few regexp's like ^?/shortcut$?, ^/shortcut$,
^/?shortcut$ and so on, but none seem to work...

Am I doing something wrong?
PS
u/user/index.html DOES exist.
On Oct 19, 6:16 pm, Andy Hassall <a...@andyh.co.ukwrote:
On 19 Oct 2006 15:12:50 -0700, "jonnybla...@gmail.com" <jonnybla...@gmail.com>
wrote:
I've searched everywhere for this but I'm not sure exactly what to
search for.
What I am trying to do is pass a variable to a php script via the URL.
However, I don't want to use the standard "?name=value format." I want
to either pass the variable as "value website.com" or
"website.com/value" where the script is stored in some directory
"website.com/script/index.php" and the value gets stored in a variable
declared within my php script.
I have seen this done but I just need some guidance on how to go about
doing it. Look up "mod_rewrite" for Apache.

--
Andy Hassall :: a...@andyh.co.uk ::http://www.andyh.co.ukhttp://www.and....co.uk/space:: disk and FTP usage analysis tool
Oct 19 '06 #3
jo*********@gmail.com wrote:
On Oct 19, 6:16 pm, Andy Hassall <a...@andyh.co.ukwrote:
>>On 19 Oct 2006 15:12:50 -0700, "jonnybla...@gmail.com" <jonnybla...@gmail.com>
wrote:

>>>I've searched everywhere for this but I'm not sure exactly what to
search for.
>>>What I am trying to do is pass a variable to a php script via the URL.
However, I don't want to use the standard "?name=value format." I want
to either pass the variable as "value website.com" or
"website.com/value" where the script is stored in some directory
"website.com/script/index.php" and the value gets stored in a variable
declared within my php script.
>>>I have seen this done but I just need some guidance on how to go about
doing it. Look up "mod_rewrite" for Apache.

--
Andy Hassall :: a...@andyh.co.uk ::http://www.andyh.co.ukhttp://www.and....co.uk/space:: disk and FTP usage analysis tool

I've read a little bit now about mod_rewrite. So, just testing it with
a simple rule I can't get it to work... I placed the following at the
top of my .htaccess file:

RewriteEngine on
RewriteRule shortcut u/user/index.html

I am using GoDaddy and they have mod_rewrite installed and enabled by
default on all their servers. So, I know thats not the issue.

I've also tried using a few regexp's like ^?/shortcut$?, ^/shortcut$,
^/?shortcut$ and so on, but none seem to work...

Am I doing something wrong?
PS
u/user/index.html DOES exist.
(Top posting fixed)

Try alt.apache.configuration. They should be able to help you with this
apache configuration problem.

P.S. Please don't top post. Thanks.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Oct 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

68
by: Marco Bubke | last post by:
Hi I have read some mail on the dev mailing list about PEP 318 and find the new Syntax really ugly. def foo(x, y): pass I call this foo(1, 2), this isn't really intuitive to me! Also I...
4
by: Andrew E | last post by:
Hi all I've written a python program that adds orders into our order routing simulation system. It works well, and has a syntax along these lines: ./neworder --instrument NOKIA --size 23...
2
by: Christian Roth | last post by:
Hi, how do I access the contents of a variable (or param) whose name is computed? Pseudo-code for demonstration, NOT WORKING: .... <xsl:param name="table.frame.void">border:...
2
by: Tom_B | last post by:
The following returns a system error of System.Xml.XPath.XPathException. Dim Nodes As XmlNodeList Nodes = doc.SelectNodes("soap:Body") How is the XPath string formed where there is a prefix...
1
by: Lars Erik Thorsplass | last post by:
I have recently ventured into the exciting world of stored procedures, but I have now become lost. Background: Am currently working on access control in a web application. My goal is to...
48
by: mahurshi | last post by:
I am new to c++ classes. I defined this "cDie" class that would return a value between 1 and 6 (inclusive) It runs fine and gives no warnings during compilation. I was wondering if you guys...
4
by: jmbn2k | last post by:
Hi... Iam a fresher from 2006 pass out.This was an interview question asked by a company for which am supposed to giv the answers as soon as possible within Monday..... The problem...
6
by: shuaishuaiyes | last post by:
Hello everyone... I'm a Chinese student and my English is very poor...So excuse me if I make grammar mistake. I want to ask some questions about "rename". I'm a beginner, so my C ..... :) I...
4
by: Shelly | last post by:
I am coding a psudo-cron job into an application that I am writing. I don't have access to write a real cron job. Here is what I did: 1 - I downloaded pseudocron.php from its website...
24
by: arnuld | last post by:
PURPOSE: see the comments. WHAT I GOT: infinite loop /* This program will simply create an array of pointers to integers * and will fill it with some values while using malloc...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.