Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: PHP Help

  1. #1
    Join Date
    Feb 2006
    Location
    Scotland
    Posts
    2,087
    Tokens
    138

    Latest Awards:

    Default PHP Help

    Hey

    Im having a few problems with PHP on my site. To view a page you would use ?view=requests or whatever the array is but when you add an action it doesnt work.

    EG :
    PHP Code:
    <form method='post' action='?view=requests&action=send'> - Doesnt Work 
    Any ideas?

    + Rep to all that help

    EDIT : Im using the C4H system on techtuts but on the admin when you try to delete/respond, It doesnt work also. The url that comes up is http://www.visualhabbo.net/v1.php?view=cfhadmin. But then when you reply the URL that comes up is http://www.visualhabbo.net/v1.php?act=reply&id=6 I dont think that is right, Should it be http://www.visualhabbo.net/v1.php?vi...act=reply&id=6
    Last edited by Johno; 17-08-2006 at 09:40 AM.

  2. #2

    Default

    <form method='post' action='send'>

    try that not sure thoe

  3. #3
    Join Date
    Nov 2005
    Posts
    807
    Tokens
    1,335

    Latest Awards:

    Default

    .. are you trying to make it process the form in the same file if so try..
    Code:
    action='<?php echo $_SERVER['PHP_SELF']; ?>?view=requests&action=send'
    or It could be a problem with your form processor.

  4. #4
    Join Date
    Feb 2006
    Location
    Scotland
    Posts
    2,087
    Tokens
    138

    Latest Awards:

    Default

    @Nick : Already tried that, Doesnt work

    Ill try that now splinter
    EDIT : Nope, Didnt work
    Last edited by Johno; 17-08-2006 at 09:57 AM.

  5. #5
    Join Date
    Feb 2005
    Location
    Leicestershire / Sheffield
    Posts
    685
    Tokens
    0

    Default

    Can i see the actual page which it is not working?

  6. #6
    Join Date
    Feb 2006
    Location
    Scotland
    Posts
    2,087
    Tokens
    138

    Latest Awards:

    Default

    PHP Code:
    <?  
    ob_start
    (); # Allows Cookies  
    include("config.php"); # Includes Your Configuration File  
    if($logged[username] && $logged[level] == 5# If Logged In AND Level 5  
    {  
    switch(
    $_GET[act]) # Lets Us Use One Page For The Entire Admin Part  
    {  
    default: 
    # The Default Page  
    $rquery mysql_query("SELECT * FROM cfh ORDER BY id DESC"); # Queries The Call For Help Messages  
    while($m=mysql_fetch_array($rquery)) # Displays Them All In Order  
    echo("<b>Username Requiring Help:</b> $m[username]  
    <br>  
    <b>Category:</b> 
    $m[category]  
    <br>  
    <b>Message:</b> 
    $m[message]  
    <br>  
    <b>Options:</b> <a href=\"?act=reply&id=
    $m[id]\">Respond</a> || <a href=\"?act=delete&id=$m[id]\">Delete</a><br><br>"); # Admin Control Panel  
    break;  
    case 
    'delete'# The Part In URL  
    $cquery mysql_query("SELECT * FROM cfh WHERE id = '$_GET[id]'"); # Queries The Call For Helps  
    $c=mysql_fetch_array($cquery); # Displays Them All In Order  
    $delete mysql_query("DELETE FROM `cfh` WHERE id = '$_GET[id]'"); # Deletes The Message From The Table  
    echo("The call for help message has been deleted!"); # Shows Message  
    break;  
    case 
    'reply'# The Part In URL  
    $rquery mysql_query("SELECT * FROM cfh ORDER BY id DESC"); # Queries The Call For Help Messages  
    while($m=mysql_fetch_array($rquery)) # Displays Them All In Order  
    if($_POST[alert]) { # If Form Has Been Submitted  
    $message $_POST[message]; # Message Variable  
    $username $_POST[username]; # Username Variable  
    mysql_query(" UPDATE `cfh` SET `alert` = '$message' WHERE `username` = '$username' "); # Adds The Alert Into The Table  
    echo ("Your alert has been sent."); # Shows Message  
    }else{ # The Form Hasnt Been Submitted Yet  
    echo("<form method=\"post\"><b>Send To:</b> <input type=\"text\" name=\"username\" value=\"$m[username]\" readonly><br>  
    <b>Alert:</b> <textarea name=\"message\"></textarea><br><br>  
    <input type=\"submit\" name=\"alert\" value=\"Alert User\"></form>"
    ); # Shows Alert Form  
    break;  
    }  
    }  
    } else { 
    # User Isn't Logged In Or Level 5  
    echo("You Are Not Logged In Or Level 5"); # Shows Message  
    }  
    ?>
    When you attempt to delete or reply the system just fails and returns you to the homepage

  7. #7

    Default

    Hi,At lest i tryed

  8. #8
    Join Date
    Feb 2006
    Location
    Scotland
    Posts
    2,087
    Tokens
    138

    Latest Awards:

    Default

    Anybody else know how to fix this?

    And cheesybob you got your rep

  9. #9

    Default

    lol thanks

  10. #10
    Join Date
    Dec 2005
    Posts
    724
    Tokens
    0

    Default

    Quote Originally Posted by ActiveVision View Post
    PHP Code:
    <?  
    ob_start
    (); # Allows Cookies  
    include("config.php"); # Includes Your Configuration File  
    if($logged[username] && $logged[level] == 5# If Logged In AND Level 5  
    {  
    switch(
    $_GET[act]) # Lets Us Use One Page For The Entire Admin Part  
    {  
    default: 
    # The Default Page  
    $rquery mysql_query("SELECT * FROM cfh ORDER BY id DESC"); # Queries The Call For Help Messages  
    while($m=mysql_fetch_array($rquery)) # Displays Them All In Order  
    echo("<b>Username Requiring Help:</b> $m[username]  
    <br>  
    <b>Category:</b> 
    $m[category]  
    <br>  
    <b>Message:</b> 
    $m[message]  
    <br>  
    <b>Options:</b> <a href=\"?act=reply&id=
    $m[id]\">Respond</a> || <a href=\"?act=delete&id=$m[id]\">Delete</a><br><br>"); # Admin Control Panel  
    break;  
    case 
    'delete'# The Part In URL  
    $cquery mysql_query("SELECT * FROM cfh WHERE id = '$_GET[id]'"); # Queries The Call For Helps  
    $c=mysql_fetch_array($cquery); # Displays Them All In Order  
    $delete mysql_query("DELETE FROM `cfh` WHERE id = '$_GET[id]'"); # Deletes The Message From The Table  
    echo("The call for help message has been deleted!"); # Shows Message  
    break;  
    case 
    'reply'# The Part In URL  
    $rquery mysql_query("SELECT * FROM cfh ORDER BY id DESC"); # Queries The Call For Help Messages  
    while($m=mysql_fetch_array($rquery)) # Displays Them All In Order  
    if($_POST[alert]) { # If Form Has Been Submitted  
    $message $_POST[message]; # Message Variable  
    $username $_POST[username]; # Username Variable  
    mysql_query(" UPDATE `cfh` SET `alert` = '$message' WHERE `username` = '$username' "); # Adds The Alert Into The Table  
    echo ("Your alert has been sent."); # Shows Message  
    }else{ # The Form Hasnt Been Submitted Yet  
    echo("<form method=\"post\"><b>Send To:</b> <input type=\"text\" name=\"username\" value=\"$m[username]\" readonly><br>  
    <b>Alert:</b> <textarea name=\"message\"></textarea><br><br>  
    <input type=\"submit\" name=\"alert\" value=\"Alert User\"></form>"
    ); # Shows Alert Form  
    break;  
    }  
    }  
    } else { 
    # User Isn't Logged In Or Level 5  
    echo("You Are Not Logged In Or Level 5"); # Shows Message  
    }  
    ?>
    When you attempt to delete or reply the system just fails and returns you to the homepage
    Don't you need // for comments
    Starting webdesign again.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •