Loading ...
Sorry, an error occurred while loading the content.

php

Expand Messages
  • ronbryce4u
    Hello, pls can you help me with a php code that can restrict access to various pages with the using of certain numbers? example 1234 takes you to service.php,
    Message 1 of 11 , Feb 4, 2012
    • 0 Attachment
      Hello, pls can you help me with a php code that can restrict access to various pages with the using of certain numbers? example 1234 takes you to service.php, 1235 takes you to the aboutus.php etc. in php. Thanks
    • Gu®u
      You are not clear about your issue. You mean if you have a text box in which user will enter 1234 and the action will take to service.php. If that is the case
      Message 2 of 11 , Feb 4, 2012
      • 0 Attachment
        You are not clear about your issue. You mean if you have a text box in which user will enter 1234 and the action will take to service.php. If that is the case use if statement. However, if not please tell us about more.


        On Sat, Feb 4, 2012 at 3:02 PM, ronbryce4u <ronbryce4u@...> wrote:
         

        Hello, pls can you help me with a php code that can restrict access to various pages with the using of certain numbers? example 1234 takes you to service.php, 1235 takes you to the aboutus.php etc. in php. Thanks




        --
        Best,
        Gu®u

      • shiplu
        Enable mod rewrite on .htaccess RewriteEngine On RewriteBase / # Rewrite all other URLs to index.php/URL RewriteRule ^(.*) .php$ index.php?name=$1 [PT,L] Now
        Message 3 of 11 , Feb 4, 2012
        • 0 Attachment
          Enable mod rewrite on .htaccess

          RewriteEngine On
          RewriteBase /

          # Rewrite all other URLs to index.php/URL
          RewriteRule ^(.*)\.php$ index.php?name=$1 [PT,L]

          Now in index.php

          <?php

          $page = do_some_sanity_check($_GET['page']);

          $fn= "/path/to/the/dir/where/i/kept/all/my/files/$page";
          if(file_exists($fn)){
          require_once $fn;
          exit;
          }else{
          header("HTTP
          }

          ?>


          --
          Shiplu.Mokadd.im
          ImgSign.com | A dynamic signature machine

          Innovation distinguishes between follower and leader

        • roland bryce
          Thanks alot. pls can i send u a sample of the website so you can understand better?
          Message 4 of 11 , Feb 4, 2012
          • 0 Attachment
            Thanks alot. pls can i send u a sample of the website so you can understand better?



            ------------------------------
            On Sat, Feb 4, 2012 6:36 AM EST shiplu wrote:

            >Enable mod rewrite on .htaccess
            >
            >RewriteEngine On
            >RewriteBase /
            >
            ># Rewrite all other URLs to index.php/URL
            >RewriteRule ^(.*)\.php$ index.php?name=$1 [PT,L]
            >
            >Now in index.php
            >
            ><?php
            >
            >$page = do_some_sanity_check($_GET['page']);
            >
            >$fn= "/path/to/the/dir/where/i/kept/all/my/files/$page";
            >if(file_exists($fn)){
            >require_once $fn;
            >exit;
            >}else{
            >header("HTTP
            >}
            >
            >?>
            >
            >
            >--
            >Shiplu.Mokadd.im
            >ImgSign.com | A dynamic signature machine
            >Innovation distinguishes between follower and leader
          • roland bryce
            something like this
            Message 5 of 11 , Feb 4, 2012
            • 0 Attachment
              something like this

              <form id="form1" name="form1" method="post" action="service.php" target="_blank">
              <label>
              <input type="text" name="n" value="Type in your number" onFocus="if(this.value=='Type in your number')this.value='';">
              </label>
              <label>
              <input type="submit" name="Submit" value="Enter" />
              </label>
              </form>

              I'll need to use the if else statement to add the code but i don't know how to use it.

              ------------------------------
              On Sat, Feb 4, 2012 6:36 AM EST shiplu wrote:

              >Enable mod rewrite on .htaccess
              >
              >RewriteEngine On
              >RewriteBase /
              >
              ># Rewrite all other URLs to index.php/URL
              >RewriteRule ^(.*)\.php$ index.php?name=$1 [PT,L]
              >
              >Now in index.php
              >
              ><?php
              >
              >$page = do_some_sanity_check($_GET['page']);
              >
              >$fn= "/path/to/the/dir/where/i/kept/all/my/files/$page";
              >if(file_exists($fn)){
              >require_once $fn;
              >exit;
              >}else{
              >header("HTTP
              >}
              >
              >?>
              >
              >
              >--
              >Shiplu.Mokadd.im
              >ImgSign.com | A dynamic signature machine
              >Innovation distinguishes between follower and leader
            • roland bryce
              thanks alot for your reply. something like this:
              Message 6 of 11 , Feb 4, 2012
              • 0 Attachment
                thanks alot for your reply. something like this:

                <form id="form1" name="form1" method="post" action="service.php" target="_blank">
                                <label>
                                  <input type="text" name="n" value="Type in your number" onFocus="if(this.value=='Type in your number')this.value='';">
                                  </label>
                                <label>
                                <input type="submit" name="Submit" value="Enter" />
                                </label>
                              </form>

                I'll need to use the if else statement to add the code but i don't know how to use it.


                From: Gu®u <nagendra802000@...>
                To: phpexperts@yahoogroups.com
                Sent: Saturday, February 4, 2012 12:28 PM
                Subject: Re: [phpXperts] php

                 
                You are not clear about your issue. You mean if you have a text box in which user will enter 1234 and the action will take to service.php. If that is the case use if statement. However, if not please tell us about more.


                On Sat, Feb 4, 2012 at 3:02 PM, ronbryce4u <ronbryce4u@...> wrote:
                 
                Hello, pls can you help me with a php code that can restrict access to various pages with the using of certain numbers? example 1234 takes you to service.php, 1235 takes you to the aboutus.php etc. in php. Thanks




                --
                Best,
                Gu®u



              • shiplu
                ... Sure. But what I have understood from your initial mail, could be achieved very easily by a PHP script. And I have sent you a PHP sample. Read the code. --
                Message 7 of 11 , Feb 5, 2012
                • 0 Attachment
                  On Sun, Feb 5, 2012 at 3:58 AM, roland bryce <ronbryce4u@...> wrote:

                  Thanks alot. pls can i send u a sample of the website so you can understand better?


                  Sure. But what I have understood from your initial mail, could be achieved very easily by a PHP script. And I have sent you a PHP sample. Read the code.

                  --
                  Shiplu.Mokadd.im
                  ImgSign.com | A dynamic signature machine

                  Innovation distinguishes between follower and leader

                Your message has been successfully submitted and would be delivered to recipients shortly.