Olá!
Estou montando um portofólio, e gostaria de usar Query String nele.
Tenho as páginas:
index.php
sobre.php
portofolio.php
servicos.php
contato.php
E quero deixar os links assim:
index.php?act=home
index.php?act=sobre
index.php?act=portofolio
index.php?act=servicos
index.php?act=contato
Obrigado pessoal
Query String
Started By WellingtonSG, 19/08/2008, 08:42
6 replies to this topic
#1
Posted 19/08/2008, 08:42
#2
Posted 19/08/2008, 13:26
use a busca amigo, existe uma infinidades de tópicos sobre Query String, juntamente com tutoriais que você precisa.
Se este post lhe ajudou, ajude o fórum também. Use a reputação de mensagens!
#3
Posted 19/08/2008, 21:02
Olá
Achei um tutorial, mas estou com uma dúvida:
Criei os arquivos act.php, home.php, well.php, contato.php e suporte.php
A Query funciona somente no home.ph e no contato.php
Aqui o arquivo act.php
Qual o erro?
Obrigado
Achei um tutorial, mas estou com uma dúvida:
Criei os arquivos act.php, home.php, well.php, contato.php e suporte.php
A Query funciona somente no home.ph e no contato.php
Aqui o arquivo act.php
<?php @$act = $_REQUEST['act']; if ($act == "well" ) { $nextPage = "well.php"; } if ($act == "suporte" ) { $nextPage = "suporte.php"; } if ($act == "contato" ) { $nextPage = "contato.php"; } if( (isset($nextPage)) and (file_exists($nextPage)) ) { include($nextPage); } else { include 'home.php'; } ?>
Qual o erro?
Obrigado
#4
Posted 19/08/2008, 23:21
Não sei se é este o problema, mas teste:
<?php $act = $_GET['act']; elseif ($act == "well" ) { $nextPage = "well.php"; } elseif ($act == "suporte" ) { $nextPage = "suporte.php"; } elseif ($act == "contato" ) { $nextPage = "contato.php"; } if( (isset($nextPage)) and (is_file($nextPage)) ) { include($nextPage); } else { include 'home.php'; } ?>
"Se quiser ser feliz por um dia, vingue-se; se quiser ser feliz por uma vida inteira, perdoe."
Muito Obrigado à todos do fórum, e à toda equipe do fórum!
#5
Posted 20/08/2008, 04:43
Olá
Retornou esse erro:
Parse error: syntax error, unexpected T_ELSEIF in /home/well/public_html/scripts/qstring/act.php on line 5
Retornou esse erro:
Parse error: syntax error, unexpected T_ELSEIF in /home/well/public_html/scripts/qstring/act.php on line 5
#6
Posted 20/08/2008, 16:48
Oopps, o código é esse:
<?php $act = $_GET['act']; if ($act == "well" ) { $nextPage = "well.php"; } elseif ($act == "suporte" ) { $nextPage = "suporte.php"; } elseif ($act == "contato" ) { $nextPage = "contato.php"; } if( (isset($nextPage)) and (is_file($nextPage)) ) { include($nextPage); } else { include 'home.php'; } ?>
"Se quiser ser feliz por um dia, vingue-se; se quiser ser feliz por uma vida inteira, perdoe."
Muito Obrigado à todos do fórum, e à toda equipe do fórum!
#7
Posted 20/08/2008, 17:59
Resolvido
Obrigado
Obrigado
1 user(s) are reading this topic
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)