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 7 of 7
  1. #1
    New Coder
    Join Date
    Sep 2005
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    I was given a php code to use for a website with no information on how to apply it.

    I have a code that sends users to a different website that is encrypted. I was told that since we build websites, we should know what to do and they don't support webmasters, the just hand out the code.

    PHP Code:
    <?php
     
            $today
    =getdate();
            
    $shift=$today['mday'];
            
    $b=$shift;
              
    $a="XXXXXXXXX";
              
    $s $a << $b;
              
    $c $a >> (32 $b);
              
    $s $s $c;
     
    header('Location: http://frankscarcare.wheelwizard.net?ackid=$s');
    ?>
    a=account number

    explaination to go with the code is: Everything is complete on this side. I just need you to add the following code at the appropriate place to get
    a connection between your web site and Wheel Wizard.



    Thanks for your help

    Alex
    Last edited by Technobabble; 09-27-2005 at 09:18 PM.

  • #2
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    It goes towards the top of your page code, before any output is written (due to header:location). It will redirect the user to the other site.

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,461
    Thanks
    0
    Thanked 632 Times in 622 Posts
    It looks more like it is intended to be a complete page in itself. If you link to that page it will then transfer automatically to the external site.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #4
    New Coder
    Join Date
    Sep 2005
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the replies,

    however, I still don't understand.

    [html]
    <a href="http://www.frankscarcare.com/ww.php">Click here</a>
    [/html]

    and

    PHP Code:
    <?php

            $today
    =getdate();
            
    $shift=$today['mday'];
            
    $b=$shift;
              
    $a="070444596";
              
    $s $a << $b;
              
    $c $a >> (32 $b);
              
    $s $s $c;

    header('Location: http://frankscarcare.wheelwizard.net?ackid=1274027036');
    ?>
    I have the html in a ww.htm (http://www.frankscarcare.com/ww.htm)
    and the php uploaded to ww.php at the same domain. That doesn't work, I am sure its something small that I am leaving out.

    Alex

  • #5
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Without knowing what this:
    http://frankscarcare.wheelwizard.net?ackid=
    Is supposed to do on their side, it does make it a little harder.

    With that aside, you are using bitwise operations, and your values should be (int) types. You have string data:
    $a="070444596";
    Which would produce like, -1610612736 or something stupid like that (today being the 27th) on a bitwise left shift. So your first operation is already toasted off.
    Simply remove your quotations around that value, and proceed from there. Shouldn't be a problem for you. If you should still have problems, ensure that your getdate() is returning in GMT format instead.

    Other than that, this is a complete script, simply modify your $a variable.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #6
    New Coder
    Join Date
    Sep 2005
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Fou-lu, you were correct in your assumption. The code basically turns the link into a secret handshake. However nothing I have done works to get it to link to the site. Untill your post telling me that the ("") didn't belong with the numbers, I couldn't get this thing to do anything. It works now that the ("") are not around the number!

    Thanks all for talking a look at this, its always the little things that bite ya!

  • #7
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    N/P
    You should still double check the date parameters on your system as well, to ensure that they are in GMT. If they are not, its a simple fix for you. Chances are you are good though, so I wouldn't be overly concerned.
    Glad it worked for you, bitwise can be tricky, when you use string data it will attempt to convert on an ascii level, which obviously you don't want to do. Thats the reason for the interesting bit shifts.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Posting Permissions

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