← CMS - Gestores de Conteúdos

Criar links com ID

Lida 2500 vezes

Offline

Thomato 
Membro
Mensagens 4125 Gostos 3
Feedback +2

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

Boa tarde.

Alguém conhece algum script que transforme os links em algo assim:

http://omeusite.com/parceiros/link=1 e por ai fora? Que só mude o link= de site para site...

Obrigado :D
Offline

Thomato 
Membro
Mensagens 4125 Gostos 3
Feedback +2

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

Ninguém conhece solução para o problema? :S
Offline

Diogo Pinto 
Administrador
Mensagens 4400 Gostos 371
Feedback +4

Troféus totais: 37
Trófeus: (Ver todos)
Avatar Search Level 6 Linux User Mobile User Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes

<?php

$link = $_GET['id'];

Header('location: $link');

?>

www.site.com/link?id=www.teste.com

isto o muito basico, o codigo nao esta correcto sequer, e para teres um ideia ;)
Offline

Thomato 
Membro
Mensagens 4125 Gostos 3
Feedback +2

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

Eu de PHP não pesco grande coisa :S
Offline

Diogo Pinto 
Administrador
Mensagens 4400 Gostos 371
Feedback +4

Troféus totais: 37
Trófeus: (Ver todos)
Avatar Search Level 6 Linux User Mobile User Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes

Desenvolvi um código para o thomato:

Gravem como link.php:

Código: [Seleccione]
<?php

$link
[0] = "http://www.aterraemmarte.com"//o link [0] é o default para a tua página
$link[1] = "http://www.maistrafego.pt";
// adiciona quantos links tu quiseres para aqui adicionando sempre mais um número

$linkobt $_GET['link'];

if (
array_key_exists($linkobt$link)) {
$linkfinal $link[$linkobt];
} else {
$linkfinal $link[0];
}

header('Location:'.$linkfinal.'');

?>

Devem aceder a: www.ovossodominio.com/link.php?link=x
Se o "x" não existir ele vai para a página que definirem!

Abraço
Offline

Thomato 
Membro
Mensagens 4125 Gostos 3
Feedback +2

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

Muito obrigado :D
Offline

João Godinho 
Membro
Mensagens 1755 Gostos 2
Troféus totais: 27
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Se se mudar isto:
$link[o que está aqui] = "http://www.maistrafego.pt";

isto também vai mudar: http://omeusite.com/parceiros/link=isto
Offline

Thomato 
Membro
Mensagens 4125 Gostos 3
Feedback +2

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

Experimenta joão :)
Offline

Diogo Pinto 
Administrador
Mensagens 4400 Gostos 371
Feedback +4

Troféus totais: 37
Trófeus: (Ver todos)
Avatar Search Level 6 Linux User Mobile User Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes

Sim, vai mudar, mas atenção que o script não funciona assim ;)