How to create URLs?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
manojsemwal1
Forum Contributor
Posts: 217
Joined: Mon Jun 29, 2009 4:13 am
Location: India

How to create URLs?

Post by manojsemwal1 »

Pl help to try to means the url
http://www.foobar.com/watch?v=Ofyb0323N ... re=related

here http://www.foobar.com/ is url
watch? here watch is directory of file name?
v=Ofyb0323NqU is video id
&feature=related

if directory name or file name so how can i do it in php
give some raugh idea....................
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: http://www.youtube.com/watch?v=Ofyb0323NqU&feature=related

Post by requinix »

I was this close to reporting this as spam, but figured I should probably read it so I could write something in the Further Information box.
manojsemwal1 wrote:if directory name or file name so how can i do it in php
"if directory name or file name"... what?
"how can I do"... what?

General Posting Guidelines
And change the title to something meaningful.
manojsemwal1
Forum Contributor
Posts: 217
Joined: Mon Jun 29, 2009 4:13 am
Location: India

Re: http://www.youtube.com/watch?v=Ofyb0323NqU&feature=related

Post by manojsemwal1 »

i meant that in url /watch? is file name or folder

if file name so without given any extension how can we do it in php.............
if it is folder name so how can i find the video in folder ....
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: http://www.youtube.com/watch?v=Ofyb0323NqU&feature=related

Post by requinix »

manojsemwal1 wrote:i meant that in url /watch? is file name or folder
Who knows? Could be a file, could be a folder.

But it's probably a file. In Apache

Code: Select all

Options +MultiViews
If the file is called "/watch.php" then using "/watch" alone will work too. No special PHP required.
manojsemwal1
Forum Contributor
Posts: 217
Joined: Mon Jun 29, 2009 4:13 am
Location: India

Re: http://www.youtube.com/watch?v=Ofyb0323NqU&feature=related

Post by manojsemwal1 »

<a href='ViewDetails.php?a=edit&id=<?php echo $Sno; ?>'>
above link iam using in my program shall i write this line as it is like...
<a href='ViewDetails?a=edit&id=<?php echo $Sno; ?>'>
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: http://www.youtube.com/watch?v=Ofyb0323NqU&feature=related

Post by requinix »

Okay.
manojsemwal1
Forum Contributor
Posts: 217
Joined: Mon Jun 29, 2009 4:13 am
Location: India

Re: http://www.youtube.com/watch?v=Ofyb0323NqU&feature=related

Post by manojsemwal1 »

Okay means yes or no ?
if yes

<a href='ViewDetails?a=edit&id=<?php echo $Sno; ?>'>

if i used like this it will searching the viewdetails file. it will not get the file and and display file not found error.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: How to create URLs?

Post by requinix »

"Okay" as in "Sure, you can do that".

Did you read the rest of my post? Like the part that talks about Apache and the Options directive?
You need MultiViews* to give links without extensions.

* There are, of course, other ways, but this is the easiest.
manojsemwal1
Forum Contributor
Posts: 217
Joined: Mon Jun 29, 2009 4:13 am
Location: India

Re: How to create URLs?

Post by manojsemwal1 »

No I did'nt read pl provide the link for me i want read .
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: How to create URLs?

Post by requinix »

manojsemwal1 wrote:No I did'nt read pl provide the link for me i want read .
Here you go. Keywords are "Apache" and "Options".
manojsemwal1
Forum Contributor
Posts: 217
Joined: Mon Jun 29, 2009 4:13 am
Location: India

Re: How to create URLs?

Post by manojsemwal1 »

iam new in php and apachie............
so pl give small example.......................to easy to understand
Post Reply