+ Reply to Thread
Results 1 to 6 of 6

Thread: Can any one help me with php

  1. #1
    dharmil's Avatar
    dharmil is offline x10 Elder dharmil is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Avenel New Jersey
    Posts
    828

    Can any one help me with php

    PHP Code:
    <?

    include "config.php";



    function 
    login_form($username) {
        echo 
    '<table border="0" width="90%" cellpadding="0" cellspacing="2">
        <form method="POST" name="login" action="?login">
        <tr>
        <td width="30%">Username:</td>
        <td><input type="text" name="username" value="'
    .$username.'" size="18"></td>
        </tr>
        <tr>
        <td width="30%">Password:</td>
        <td><input type="password" name="password" size="18"></td>
        </tr>
        <tr>
        <td width="30%"></td>
        <td><input type="submit" value="Login" name="login">
        </td>
        </tr>
        </form></table>'
    ;
    }




    if (isset(
    $_POST[login])) {


    if (
    $admins[$_POST[username]] == $_POST[password]) {

    setcookie("newsuser""$_POST[username]"$time+60*60*24*30 );
    setcookie("newspass""$_POST[password]"$time+60*60*24*30 );
    echo 
    'Logged in<br><a href="admin.php?act=post">Post News</a>';
    echo 
    '<br><a href="news.php">Home</a>';

    } else {
    login_form("$_POST[username]");
    }

    } else {

    login_form("");

    }



    ?>
    then i cant put the add code because i can edit it gets a arror

  2. #2
    Brandon Guest

    Re: Can any one help me with php

    Here Advanced
    PHP Code:
    <?

    include "config.php";



    function 
    login_form($username) {
        echo 
    '<table border="0" width="90%" cellpadding="0" cellspacing="2">
        <form method="POST" name="login" action="?login">
        <tr>
        <td width="30%">Username:</td>
        <td><input type="text" name="username" value="'
    .$username.'" size="18"></td>
        </tr>
        <tr>
        <td width="30%">Password:</td>
        <td><input type="password" name="password" size="18"></td>
        </tr>
        <tr>
        <td width="30%"></td>
        <td><input type="submit" value="Login" name="login">
        </td>
        </tr>
        </form></table>'
    ;
    }




    if (isset(
    $_POST[login])) {


    if (
    $admins[$_POST[username]] == $_POST[password]) {

    setcookie("newsuser""$_POST[username]"$time+60*60*24*30 );
    setcookie("newspass""$_POST[password]"$time+60*60*24*30 );
    echo 
    'Logged in<br><a href="admin.php?act=post">Post News</a>';
    echo 
    '<br><a href="news.php">Home</a>';

    } else {
    login_form("$_POST[username]");
    }

    } else {

    login_form("");

    }



    ?> 
    <?php include('http://staff.x10hosting.com/adCode.php?ad=advanced'); ?>
    Here Corpreate
    PHP Code:
    <?

    include "config.php";



    function 
    login_form($username) {
        echo 
    '<table border="0" width="90%" cellpadding="0" cellspacing="2">
        <form method="POST" name="login" action="?login">
        <tr>
        <td width="30%">Username:</td>
        <td><input type="text" name="username" value="'
    .$username.'" size="18"></td>
        </tr>
        <tr>
        <td width="30%">Password:</td>
        <td><input type="password" name="password" size="18"></td>
        </tr>
        <tr>
        <td width="30%"></td>
        <td><input type="submit" value="Login" name="login">
        </td>
        </tr>
        </form></table>'
    ;
    }




    if (isset(
    $_POST[login])) {


    if (
    $admins[$_POST[username]] == $_POST[password]) {

    setcookie("newsuser""$_POST[username]"$time+60*60*24*30 );
    setcookie("newspass""$_POST[password]"$time+60*60*24*30 );
    echo 
    'Logged in<br><a href="admin.php?act=post">Post News</a>';
    echo 
    '<br><a href="news.php">Home</a>';

    } else {
    login_form("$_POST[username]");
    }

    } else {

    login_form("");

    }



    ?> 
    <?php include('http://staff.x10hosting.com/adCode.php?ad=corporate'); ?>
    Last edited by DesertWar; 12-18-2005 at 01:23 PM.

  3. #3
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,608

    Re: Can any one help me with php

    An easy way to do this is just put:

    Advanced:
    PHP Code:
    include('http://staff.x10hosting.com/adCode.php?ad=advanced'); 
    Corporate:
    PHP Code:
    include('http://staff.x10hosting.com/adCode.php?ad=corporate'); 
    Just a suggestion. It looks as if DesertWar helped you already though. :-)

  4. #4
    Brandon Guest

    Re: Can any one help me with php

    Thanks Nedren thats what I did just added it at the end of his php code.

  5. #5
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,608

    Re: Can any one help me with php

    Ohhhh I didn't even see that. I'm sorry.. :-( Haha. I'm making myself look like an ass. :-\

  6. #6
    dharmil's Avatar
    dharmil is offline x10 Elder dharmil is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Avenel New Jersey
    Posts
    828

    Re: Can any one help me with php

    thanks

+ Reply to Thread

Similar Threads

  1. Ever Been Suspended For Using PHP?
    By dragoneye_xp in forum Off Topic
    Replies: 26
    Last Post: 08-16-2009, 07:17 PM
  2. [PHP] Variables in PHP
    By Bryon in forum Tutorials
    Replies: 15
    Last Post: 01-29-2009, 09:46 AM
  3. tons of PHP Resources
    By Chris S in forum Scripts & 3rd Party Apps
    Replies: 10
    Last Post: 01-16-2009, 10:07 AM
  4. [PHP] PHP For Starters
    By Complex in forum Tutorials
    Replies: 24
    Last Post: 06-14-2008, 11:40 PM
  5. Unstand PHP?
    By o0slowpaul0o in forum Tutorials
    Replies: 8
    Last Post: 01-07-2008, 09:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers