Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member Drattis's Avatar
    Join Date
    Nov 2012
    Posts
    23
    Member #
    33947
    Liked
    1 times
    Since last time i've made so that only the site owners can upload images by loging in on a half secret URL. I have also made so that everytime we upload an image PHP code creates a new file and copies the information from my template file (template.php) and pastes it in the newly created file with the name of the ID in my image table. The id is on Auto increment so it increases with 1 for every upload and so does the file name of the newly created file.
    My problem is that the only thing i get is this www.drattis.com/44.php (5 lines of code that is bold bellow) when it should be like bellow which is the template.php file:

    <?php
    include 'core/init.php';
    include 'includes/overall/headerover.php';
    ?>

    <title>
    <?php
    include 'get.php';
    include 'upload.php';
    if($id === $lastid){
    echo "Funny Pictures for everybody - Drattis.com";
    }else{
    echo "$_POST[title]";
    }
    ?>
    </title>

    <?php
    include 'includes/overall/headerunder.php';
    ?>

    <div id="main">
    <div id="leftcontainer">
    <div id="bar">
    <h1>
    <?php
    include 'get.php';
    include 'upload.php';
    echo "$_POST[title]";
    ?>
    </h1>
    </div>
    <div id="arrows">
    <a href=
    "<?php
    include 'get.php';
    include 'upload.php';
    $prevint = $id - 1;
    $prev = "$prevint" . ".php";
    if($id === $lastid){
    echo "1.php";
    }else{
    echo "$prev";
    }
    ?>"
    class="borderit"><img border="0" src="images/prev.png"/></a>
    <a href=
    "<?php
    include 'get.php';
    include 'upload.php';
    $nextint = $id + 1;
    $next = "$nextint" . ".php";
    echo "$next";
    ?>"
    class="borderit"><img border="0" src="images/next.png"/></a>
    </div>
    <br>
    <br>
    <div id="imagepart">
    <hr size=1 color= #ccc>
    <br>
    <img src="images/funnypictures/test.jpg"/>
    <br>
    <br>
    <!-- Begin: adBrite, Generated: 2012-11-11 12:50:34 -->
    <script type="text/javascript">
    var AdBrite_Title_Color = 'CC0000';
    var AdBrite_Text_Color = '191919';
    var AdBrite_Background_Color = 'FFFFFF';
    var AdBrite_Border_Color = 'CCCCCC';
    var AdBrite_URL_Color = '008000';
    var AdBrite_Page_Url = '';
    try{var AdBrite_Iframe=window.top!=window.self?2:1;var AdBrite_Referrer=document.referrer==''?document.lo cation:document.referrer;AdBrite_Referrer=encodeUR IComponent(AdBrite_Referrer);}catch(e){var AdBrite_Iframe='';var AdBrite_Referrer='';}
    </script>
    <span style="white-space:nowrap;"><script type="text/javascript">document.write(String.fromCharCode(60, 83,67,82,73,80,84));document.write(' src="http://ads.adbrite.com/mb/text_group.php?sid=2243370&zs=3436385f3630&ifr=' AdBrite_Iframe '&ref=' AdBrite_Referrer '&purl=' encodeURIComponent(AdBrite_Page_Url) '" type="text/javascript">');document.write(String.fromCharCode( 60,47,83,67,82,73,80,84,62));</script>
    <!-- End: adBrite -->
    <br>
    <br>
    <span class='st_facebook_hcount' displayText='Facebook'></span>
    <span class='st_fblike_hcount' displayText='Facebook Like'></span>
    <span class='st_twitter_hcount' displayText='Tweet'></span>
    <span class='st_plusone_hcount' displayText='Google +1'></span>
    <br>
    <hr size=1 color= #ccc>
    </div>
    <br>
    <br>
    <br>
    <br>
    </div>

    <?php include 'includes/rightcontainer.php'; ?>
    </div>
    </div>

    <?php include 'includes/overall/footer.php'; ?>

  2.  

  3. #2
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    Did you make sure that the folder where the files are being "created" has write permissions ?

    That's the biggest problem with trying to create a "new file" from a template, you have to open permissions that you may not want to...

    If everything is in a DB and you're just sending variables and re-writing links... Permissions are a non issue, except for those tha need to connect to the DB.

    BTW ... It might be a secret URL to you and those that aren't looking for it, but those things rarely work out.. The URL is written to numerous log files somewhere... Firewall logs, proxy logs, etc...

    I read an article not to long ago about a guy that managed firewalls for several large companies, he got caught selling a copy of the log files to ? Why would be do that ? Money I guess, point is... Just because you think it's safe doesn't make it safe.

  4. #3
    Junior Member cpowell89's Avatar
    Join Date
    Dec 2012
    Location
    England
    Posts
    6
    Member #
    34201
    If you're based on a Linux server setting the folder permissions to 777 should show if it's some sort of write permissions error.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:40 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com