Results 1 to 7 of 7

Thread: How to hide a relationship with php ?

  1. #1
    Join Date
    Nov 2008
    Posts
    996

    How to hide a relationship with php ?

    I try to hide the address of links on my site, so they do not appear in the status bar (to avoid fraud memberships for those who know)

    I found this code, but it does not ... I have put in a test.php page:

    Code:
    <a href="test.php?site=1"> link </a> 
    <? 
    switch(site)
    {
    case 1: header ( "Location: " ... ); break; 
    case 2: header ( "Location: " ... ); break; 
    default: header ( "Location: " ... ); 
    }
    ?>
    Can anyone help?

  2. #2
    Join Date
    Feb 2008
    Posts
    194

    Re: How to hide a relationship with php ?

    Several errors:

    - Documentation PHP header () indicates that header () must be called before any content is sent.
    - Switch (site) is not syntactically correct, replace it by: switch ($ _GET [ 'site'])

    Also, if I understood the code that you have found and what you want to link your <a href="http://forums.techarena.in/software-development/..."> ...</ a> and the switch () {... } do not belong in the same file/script. Logically it creates a confusion between client/server.

  3. #3
    Join Date
    Nov 2008
    Posts
    996

    Re: How to hide a relationship with php ?

    I am rather "novice" you can tell me a bit more?

    I made 2 pages:

    test.php:

    Code:
     <body> 
    <a href="redirect.php?site=1"> link </ a> 
    </body>

    redirect.php:

    Code:
    <body> 
    <? 
    switch ($ _GET [ 'site']) 
    {
    case 1: header ( "Location: ..." ...); break; 
    case 2: header ( "Location: ..." ...); break; 
    default: header ( "Location: ..." ...); 
    }
    ?> 
    </body>
    But it does not ...

    Plz help

  4. #4
    Join Date
    May 2008
    Posts
    945

    Re: How to hide a relationship with php ?

    First, it is <?php and not <? to make PHP.

    Otherwise, it is header + Location that are headers. Headers, that by definition itself before anything else, either:

    PHP Code:
    <?php 
    switch ($ _GET 'site']) 
    {
    case 
    1header "Location: ..." ...); break; 
    case 
    2header "Location: ..." ...); break; 
    default: 
    header "Location: ..." ...); 
    }
    ?>

    Neither more nor less.

  5. #5
    Join Date
    Nov 2008
    Posts
    996

    Re: How to hide a relationship with php ?

    Thank you Lemog, your idea worked.

    I found something, simple with form:

    Code:
    <form action="http://..." method="post" name="form1" target="_blank" id="form1">
    <input type="image" src="http://forums.techarena.in/images/buttons/button1.jpg"/> 
    </form>
    But now I have another problem... my image of the button, I would like to see an image over it ...

    I get it not ...

    Have an idea?

  6. #6
    Join Date
    May 2008
    Posts
    945

    Re: How to hide a relationship with php ?

    Basically, in HTTP, you first send headers then the data.

    So check whether you do not have spaces, line breaks or otherwise, that are sent with the <?php.

  7. #7
    Join Date
    Nov 2008
    Posts
    996

    Re: How to hide a relationship with php ?

    YES! it works! thank you very much!

Similar Threads

  1. is there any way to Hide relationship status in Facebook
    By mbangali in forum Technology & Internet
    Replies: 3
    Last Post: 21-08-2011, 09:28 AM
  2. Relationship bar gone in The Sims 3
    By RAM|ANUJA in forum Video Games
    Replies: 4
    Last Post: 26-07-2011, 08:31 PM
  3. Relationship between CPU & FSB
    By Untrusted in forum Motherboard Processor & RAM
    Replies: 5
    Last Post: 23-01-2011, 08:24 AM
  4. Auto-Hide toolbar won't hide?
    By Geoff from LA in forum Vista Help
    Replies: 8
    Last Post: 18-10-2009, 06:52 AM
  5. Relationship between FSB & RAM on the MSI K9N Platinum AM2
    By Deepest BLUE in forum Overclocking & Computer Modification
    Replies: 3
    Last Post: 20-02-2009, 12:01 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,277,114.99613 seconds with 16 queries