Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
PHP Small Help Needed
Old 02-28-2009, 12:21 PM PHP Small Help Needed
Haris's Avatar
Novice Talker

Posts: 11
Name: Ali Haris
Trades: 0
Hello..

I know how to create pages like this (index.php?page=success). I want create like (index.php?success). Can anyone teach me how to do this.

Please post the codes here.

Thank you,
Haris is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-01-2009, 07:19 AM Re: PHP Small Help Needed
Super Spam Talker

Latest Blog Post:
PSD Squirrel Launched
Posts: 932
Trades: 7
Hi Haris,

There are a handful of ways to tackle this... one is mod rewrire

Another is calling the script_uri in PHP from the global variables and chopping off the first part, then slicing up the variables that follow... script_uri can be found within the HTTP_SERVER_VARS array, start off by printing it to the screen and you will see what I mean.

There are more, though try these out first, they are quite simple ways of doing what you are trying to get to.

Best of luck,
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Sir P is offline
Reply With Quote
View Public Profile Visit Sir P's homepage!
 
Old 03-01-2009, 08:11 AM Re: PHP Small Help Needed
Defies a Status

Posts: 1,606
Trades: 0
Depends on what you are trying to do. A lot of times when you see a url like that data has been input (usually from a form) and the result is posted to that page where one or more choices of action exist and one of them happens based on the submitted value.

Sometimes it is simply the link that was clicked. Whether a form submission or a link it is created via the same method;
form action= "index.php?page=success" or
href="index.php?page=success"

edit: I have one page where a list of results from a mysql query is listed and there are 3 options for each item. Edit, view, delete. The result is posted to the same page but the action is different based on the query string submitted.
__________________
Colbyt

Please login or register to view this content. Registration is FREE

Last edited by colbyt; 03-01-2009 at 08:14 AM..
colbyt is offline
Reply With Quote
View Public Profile
 
Old 03-01-2009, 09:18 AM Re: PHP Small Help Needed
Haris's Avatar
Novice Talker

Posts: 11
Name: Ali Haris
Trades: 0
Im trying to use that on a form

contact.php?success & contact.php?fail

Both page i need & i will display the form on contact.php

Any idea?
Haris is offline
Reply With Quote
View Public Profile
 
Old 03-01-2009, 09:41 AM Re: PHP Small Help Needed
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
That is NOT two different pages, two different URIs to the same page, yes. But only one page.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-01-2009, 10:16 AM Re: PHP Small Help Needed
Defies a Status

Posts: 1,606
Trades: 0
I would say based on your questions you are in over your head on this one.

It would be more like contact.php?act=success & contact.php?act=fail

Somewhere you will need to determine which value is correct and then post back to the page the value selected.

Determine what the value is and then write the routines for each value.
__________________
Colbyt

Please login or register to view this content. Registration is FREE
colbyt is offline
Reply With Quote
View Public Profile
 
Old 03-08-2009, 01:16 AM Re: PHP Small Help Needed
Corey's Avatar
Super Talker

Latest Blog Post:
Pre-Pop Offers
Posts: 142
Name: Corey
Location: United States
Trades: 0
I think you are wanting to do this:
PHP Code:
<?php
    
if(isset($_GET['success'])) {
        echo 
"The form was submitted successfully.";
    } elseif(isset(
$_GET['fail'])) {
        echo 
"The form was not submitted.";
    }
?>
__________________

Please login or register to view this content. Registration is FREE

Phone: 888-400-4359 || AIM S/N: CoreyPeerFly
Launched in 2008 - Daily Payments by PayPal

Last edited by Corey; 03-08-2009 at 01:17 AM..
Corey is offline
Reply With Quote
View Public Profile Visit Corey's homepage!
 
Reply     « Reply to PHP Small Help Needed
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.25774 seconds with 12 queries