Jump to content

Unirawan

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Posts posted by Unirawan

  1. Programming is a passion. You need to enjoy what you are doing and enjoy the troubleshooting process, because that's all programming really is - a series of problems you find solutions to in code. You need to look forward to those stumbling blocks that transform into learning milestones. It takes huge amounts of time, drive, ambition, and dedication.

     

    Reference materials are a must, whether they be tutorials (just to get you started and keep you interested), books, and http://php.net/ is a lifesaver.

  2. if this is a permanent redirect, use the following at the top of index.php

    <?php
    Header( "HTTP/1.1 301 Moved Permanently" );
    Header( "Location: http://www.new-url.com/" ); 
    ?>

     

    if its temporary or situational, remove the 301 line

     

    this can also be done with htaccess:

    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*) http://www.new-url.com/$1 [R=301,L] 

     

    and htaccess if this is only a redirect to www.

    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^new-url.com [nc]
    rewriterule ^(.*)$ http://www.new-url.com/$1 [r=301,nc] 

     

  3. it's untested but should work.

     

    <?php
    $target = '/files/';
    $foldername = $_POST['lastname'];
    $structure = $target.$foldername.'/';
    if (!mkdir($structure, 0777, true))
       {
          die('Failed to create folders...');
       }
    if(move_uploaded_file($_FILES['userfile']['tmp_name'], $structure.basename( $_FILES['userfile']['name']))
       {
          echo "<center>The file ". basename( $_FILES['userfile']['name']). " has been uploaded.</center>"; 
       } 
    else 
       { 
          echo "No File was uploaded";
       }
    ?>
    

  4. the $_REQUEST array will contain passed $_POST and $_GET data regardless of the method declaration.

     

    as to protection, use a challenge-response mechanism protection (like captcha/reCaptcha) to prevent automation through your forms. I do not recommend session tickets in hidden form values because they can be bypassed automatically by parsing the html for the hidden values.

     

     

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.