Is there any way to combine "url rewrite" and Header()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aRTx
    New Member
    • Jun 2007
    • 30

    Is there any way to combine "url rewrite" and Header()

    Can anyone explain how to combine "url rewrite" and header() function.

    example:
    header('Locatio n: http://www.abc.com/a.php?username= abc&password=bs d');
    rewrite url as: http://www.abc.com/a.php?somethingelse
  • kovik
    Recognized Expert Top Contributor
    • Jun 2007
    • 1044

    #2
    Originally posted by aRTx
    Can anyone explain how to combine "url rewrite" and header() function.

    example:
    header('Locatio n: http://www.abc.com/a.php?username= abc&password=bs d');
    rewrite url as: http://www.abc.com/a.php?somethingelse
    You could perform URL rewriting through the header function, but why? You would lose all of the functionality that URL rewriting is supposed to give you. Look into mod_rewrite and read my URL parsing tutorial.

    Comment

    • aRTx
      New Member
      • Jun 2007
      • 30

      #3
      This is the problem:

      header('Locatio n: http://www.abc.com/a.php?username= abc&password=bs d');

      The "header" go to another web(when i have an account) to post my data, but my clients can see the username and password, so what can I do to prevent anyone to steal my username and password!

      Thanks!

      Comment

      • kovik
        Recognized Expert Top Contributor
        • Jun 2007
        • 1044

        #4
        Originally posted by aRTx
        This is the problem:

        header('Locatio n: http://www.abc.com/a.php?username= abc&password=bs d');

        The "header" go to another web(when i have an account) to post my data, but my clients can see the username and password, so what can I do to prevent anyone to steal my username and password!

        Thanks!
        Don't put it in the URL. Why would you ever do this? What are you trying to do?

        Comment

        • aRTx
          New Member
          • Jun 2007
          • 30

          #5
          This is what i am doing:

          I have an "Internet caffe", and i want to give to my client a limited sms gratis. I have an account at www.smsdiscount.com and they let user to use service with url: https://myaccount.smsdi scount.com/clx/sendsms.php?use rname=xxx&passw ord=xxx&from=xx x&per=xxx&text= xxx";

          I have created a simple html form and I am working with php. In html form I have this:

          [HTML]<form action="sms.php " onMouseOver="wi ndow.status='aR Tx center'; return true;" onMouseOut="win dow.status=''; return true method="post" >
          <label for="to">Numri</label><br/>
          <input type="text" name="to" value="+37744xx xxxx" size="20" >
          <p>
          <label for="from">Send er</label><br/>
          <input type="text" name="from" value="<?echo $_SESSION['user']; ?>" size="20" ><br/>
          </p>
          <label for="text">Mess age</label><br/>
          <textarea size="50" rows="8" name="text" cols="40" onKeyDown="limi tText(this.form .text,this.form .countdown,160) ;"
          onKeyUp="limitT ext(this.form.t ext,this.form.c ountdown,160);" > </textarea>
          </p>
          <table>
          <td valign="top">&n bsp;</td>
          <td><input name="submit" type="submit" id="submit" value="submit" onSubmit=mbylle () />

          When i post this at "sms.php", there I put my username and password of my account at the service, but to have the url that accept the service I used header like this:

          $url = "https://myaccount.smsdi scount.com/clx/sendsms.php?use rname=".$userna me."&password=" .$password."&fr om=".$from."&to =".$to."&text=" .$text;

          header('Locatio n: '.$url);[/HTML]

          But my clients steal my password in the URL. I have hide it with the frameset but It was a siple trick to hack it. So what should I do to prevent the hacking my account.
          Thanks for support!

          Comment

          • kovik
            Recognized Expert Top Contributor
            • Jun 2007
            • 1044

            #6
            Maybe you should try to use cURL.

            Comment

            Working...