Wow Web Designs Forums Home

Search
   
Members

Calendar

Help

Home
Search by username
Not logged in - Login | Register 


$self?
 Moderated by: Aycan  

New Topic

Reply

Print
AuthorPost
jkewlo
Member
 

Joined: Mon Sep 15th, 2003
Location: Farmville, Virginia USA
Posts: 5
Status:  Offline
Mana: 
 Posted: Sun Nov 11th, 2007 09:55 pm

Quote

Reply
Ok so say i have my links
<a href="<? echo "$self?action=addnews" ?>">ADD NEWS</a><br />
                <a href="<? echo "$self?action=modify" ?>">MODIFY NEWS</a><br />
                <a href="<? echo "$self?action=delete" ?>">DELETE NEWS</a><br />
                <a href="<? echo "$self?action=editban" ?>">EDIT/BANN USERS</a></div>
 

correct.

now i want it to load the actions

for news it would have without the php tags
<form action='$self?action=addnews' name='addnews' method='post'>
<table>
    <tr>
        <td>
        Author
        </td>
    </tr>
    <tr>
        <td>
        <input type='text' name='author'>
        </td>
    </tr>

        <tr>
        <td>
        Title
        </td>
    </tr>
    <tr>
        <td>
        <input type='text' name='title'>
        </td>
    </tr>
    <tr>
        <td>
        News
        </td>
    </tr>
    <tr>
        <td>
        <textarea cols='50' name='text' rows='20'></textarea>
        </td>
    </tr>
    <tr>
        <td>
        <input type='submit' name='add_news' value='submit news topic'>
        </td>
    </tr>
</table>
</form>";   
}

?>


and so on with each link how would i load that from the link so say i wanted to edit the editban users and the page loads on it self what would i do to get it to load the info?

would i put it in a funtion called editban?

and then

use something like
if(!isset($_POST['editban']))


??

im really confused on this. i just want it so that i dont have static pages for everything. and would like it all to intergrated into the adminl.php?action=


website url timelessagony.net/b3/test

i have created a testaccount with admin rights

username: testaccount
password: qwerty


Thanks

Johnny



Last edited on Sun Nov 11th, 2007 09:58 pm by jkewlo

biggazza
Member
 

Joined: Tue Feb 12th, 2008
Location:  
Posts: 5
Status:  Offline
Mana: 
 Posted: Tue Feb 12th, 2008 11:15 am

Quote

Reply
OOOPS, ONLY JUST SAW THE DATE ON THE ORIGINAL POST... SORRY!!!!



you wouldnt use the post array

you would use the $_GET array

do something like

$myaction = $_GET['action'];


then check against $myaction

i.e.

switch ($myaction)
{
    case 'modify':
       .....
    break;

    case 'delete':
       ....
    break;

    case 'editban':
       ....
    break;

    default:
       die(); // Just dieing here because this will mean anything else won't work
}

 



make sure you sanitise your $_GET array though, you don't want people to be able to inject anything dodgy in there

Last edited on Tue Feb 12th, 2008 11:16 am by biggazza

resource004
Member
 

Joined: Fri Apr 4th, 2008
Location:  
Posts: 65
Status:  Offline
Mana: 
 Posted: Thu Apr 24th, 2008 07:55 am

Quote

Reply
Hi Friends,
Do you have any problem in web designing and development or do you want any kind of help in PHP/MYSQL or you need reliable and cheap web hosting or have any problem in E-commerce solutions then go to this site http://www.pakandu.com/contactus.php ,
It is a company of web designing and development and it have a great web designers, developers and Programmers.
When I got in any problem of web designing /development and Programming  or I need reliable web hosting or facing any problem in E-commerce Solutions then I just go to this site and ask them the solution of my problem and they always provide me best solution for my problem.
So do you have any above problems then contact them without any hesitation.
 
Regards,
 
Resource


 Current time is 07:50 pm




Powered by WowBB 1.7 - Copyright © 2003-2006 Aycan Gulez
Page processed in 0.1435 seconds (11% database + 89% PHP). 16 queries executed.