Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New to the CF scene
    Join Date
    Oct 2013
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Php extension modules

    I don't know if this is the right name for the problem.
    I have a website where the page links look like this name.drac instead of name.php.

    This is the code that stands for the module i think(include.php):
    <? function modules(){
    if(isset($_GET['drac'])){
    $drac = $_GET['drac'];
    if (is_file("modes/".$drac.".php")) {
    include("modes/".$drac.".php"); }}}?>



    This is how it is included along the others includes in the index.php:
    <?php
    session_start();
    include('includes/include.php');
    include("database.php");
    include("login.php");
    ?><!DO

    And when i click on signup.drac it returns an 404 error.

    What is it wrong here or what i didn't understood? I'm new to php.

    Thank you for the help!

    if it helps more, this is the link: http://animalut.comuv.com/

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,978
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    That's not a PHP issue. Your link itself is taking you to a page that does not exist; this is a client side -> server software issue.
    None of the code you have listed would cause a 404.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #3
    New to the CF scene
    Join Date
    Oct 2013
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    What actions can i take to make it work?
    I uploaded the website script to ***************

    I really don't know how to make it work, I can even give the script if needed. I'm just looking to make it work, thank you for your reply so far!

  • #4
    Senior Coder
    Join Date
    Sep 2010
    Posts
    1,899
    Thanks
    15
    Thanked 226 Times in 226 Posts
    Quote Originally Posted by AlexAli View Post
    What actions can i take to make it work?
    I uploaded the website script to ***************

    I really don't know how to make it work, I can even give the script if needed. I'm just looking to make it work, thank you for your reply so far!
    drac is the page name, not the extension. It could be submitted in a form, or more likely in a URL. http://thesite.com?drac=page3 The page extesion is still php, but the wrong value is geing given for drac, the page name, hence the 404.
    Welcome to http://www.myphotowizard.net

    where you can edit images, make a photo calendar, add text to images, and do much more.


    When you know what you're doing it's called Engineering, when you don't know, it's called Research and Development. And you can always charge more for Research and Development.

  • #5
    New to the CF scene
    Join Date
    Oct 2013
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Sorry, it's really hard to understand what you want to say, it you can give me more details. Thanks

  • #6
    Senior Coder
    Join Date
    Sep 2010
    Posts
    1,899
    Thanks
    15
    Thanked 226 Times in 226 Posts
    Quote Originally Posted by AlexAli View Post
    Sorry, it's really hard to understand what you want to say, it you can give me more details. Thanks
    I really looked at your site and you do have links that go to .drac files, but I don't know what that means or how they got there. Did you make this site yourself ? If not you should ask the person who wrote it how those links are supposed to work. This is not a 'normal' type of problem to deal with, so I doubt if anyone here has the solution.
    Welcome to http://www.myphotowizard.net

    where you can edit images, make a photo calendar, add text to images, and do much more.


    When you know what you're doing it's called Engineering, when you don't know, it's called Research and Development. And you can always charge more for Research and Development.

  • #7
    New to the CF scene
    Join Date
    Oct 2013
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Full details

    I did some research on google to know how to explain all the problem. Found on google that the problem can come from the .htacces file. I opened it and found some definitions for drac there. I don't know very well what they can mean. So if you click on index page on Inregistrare (Inregistrare.drac) it should open the page Inregistrare.php that is located in modes/ folder and not to return a 404 error. Normally on index page it would look like Inregistrare.php instead of Inregistrare.drac. Can it be a wrong misconfiguration between include.php and htacces?

    About this website. The creator of the script is unknown! This script just passed from person to person and who succeeded to make it work came with their own designs. May I have to change some codes to make it fit to the server? The provider for the script can't support me because he is not skilled in php. I just have to fix this problem in order to begin adding my own design to this script.


    These are the contents of the files:

    - htaccess:

    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*).drac$ index.php?drac=$1&

    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule dracusor-(.*)-(.*)$ index.php?drac=dracusor&id=$1&dracusor=$2


    - include.php located in the includes/ folder:

    <? function modules(){
    if(isset($_GET['drac'])){
    $drac = $_GET['drac'];
    if (is_file("modes/".$drac.".php")) {
    include("modes/".$drac.".php"); }}}?>

    - index.php:

    <?php
    session_start();
    include('includes/include.php');
    include("database.php");
    include("login.php");
    ?><!DOCTYPE HTML...
    .....
    <tr>
    <td width="117" height="35"><a href="index.php"><img src="images/draclog_03.gif" width="117" height="39" border="0"></a></td>
    <td width="125"><a href="Inregistrare.drac"><img src="images/draclog_04.gif" width="125" height="39" border="0"></a></td>
    <td width="150"><a href="Top_Dracusori.drac"><img src="images/draclog_05.gif" width="150" height="39" border="0"></a></td>
    <td width="135"><a href="Despre_Joc.drac"><img src="images/draclog_06.gif" width="135" height="39" border="0"></a></td>
    .....



    Is it possible for the variables to be to old? Is such thing possible? Or what is the issue why the link to the desired page is not executed?
    I uploaded the website on 000webhost servers if this helps.
    Thank you!

  • #8
    Senior Coder
    Join Date
    Sep 2010
    Posts
    1,899
    Thanks
    15
    Thanked 226 Times in 226 Posts
    I sort of suspected that this might involve rewrite rules, so I'm not too surprised. And your host may or may not support them, or they may have to be changed, or may not be needed at all. Maybe see what happens when you change some of the files and links to php, and go from there.
    Welcome to http://www.myphotowizard.net

    where you can edit images, make a photo calendar, add text to images, and do much more.


    When you know what you're doing it's called Engineering, when you don't know, it's called Research and Development. And you can always charge more for Research and Development.

  • Users who have thanked DrDOS for this post:

    AlexAli (10-16-2013)

  • #9
    New to the CF scene
    Join Date
    Oct 2013
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Solved!!

    I solved the problem and I want to share the solution because someday it can help you guys.

    Their servers are using virtual user home directory paths and it required this line to the very top of the .htacces file: RewriteBase / in order for the website to rewrite the links.

    Thank you very much for your help! Your information was useful for me, It helped me to understand the problem to know what to google.

    Good luck!


  •  

    Posting Permissions

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