Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 06-01-2009
Member
 
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?
Reply With Quote
  #2  
Old 06-01-2009
Member
 
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.
Reply With Quote
  #3  
Old 06-01-2009
Member
 
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
Reply With Quote
  #4  
Old 06-01-2009
Member
 
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.
Reply With Quote
  #5  
Old 06-01-2009
Member
 
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?
Reply With Quote
  #6  
Old 06-01-2009
Member
 
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.
Reply With Quote
  #7  
Old 06-01-2009
Member
 
Join Date: Nov 2008
Posts: 996
Re: How to hide a relationship with php ?

YES! it works! thank you very much!
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


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


All times are GMT +5.5. The time now is 03:37 AM.