17S17 Posted May 24, 2008 at 09:13 PM Report Share #187262 Posted May 24, 2008 at 09:13 PM boas gostava de saber como posso fazer tipo index.php = ?a=54 como posso fazer?? fica bem Link to comment Share on other sites More sharing options...
cyclop Posted May 25, 2008 at 05:52 PM Report Share #187407 Posted May 25, 2008 at 05:52 PM vais ao endereço e metes isso... index.php?a=valor&b=valor... ou entao tambem um link... <a href="index.php?a=valor&b=valor">texto</a> Mas se por acaso queres USAR VALORES POR $_GET... isso já é outra historia e tens de dizer o que queres ao certo... "Quando eu for grande quero ser como o Celso" Link to comment Share on other sites More sharing options...
softklin Posted May 25, 2008 at 07:37 PM Report Share #187440 Posted May 25, 2008 at 07:37 PM Só como complemento à resposta do ciclop, que pela tua pergunta, parece ser aquilo que pretendes, o modo de acederes à variaveis é: supor que fazes index.php?valor=15&descricao=morangos&a=54 para acederes a estes elementos, terás de usar a variável $_GET, que é um array e se acede assim: $_GET['valor'] (o resultado será 15) $_GET['a'] (o valor é 54) $_GET['descricao'] (o valor será 'morangos') Um aparte, parece que ainda estás muito no ínicio em PHP. Isto porque usar variáveis $_GET é quase "a toda a hora" 😄 Aconselho-te a procurar um bons tutorias de PHP e vais ver que aprendes isso num instante, é bastante fácil 😄 Começa por www.php.net Nick antigo: softclean | Tens um projeto? | Wiki P@P Ajuda a comunidade! Se encontrares algo de errado, usa a opção "Denunciar" por baixo de cada post. Link to comment Share on other sites More sharing options...
17S17 Posted May 25, 2008 at 07:46 PM Author Report Share #187443 Posted May 25, 2008 at 07:46 PM boas o certo e http://localhost/>?2 era isso ? Link to comment Share on other sites More sharing options...
pedrotuga Posted May 25, 2008 at 07:54 PM Report Share #187446 Posted May 25, 2008 at 07:54 PM boas o certo e http://localhost/>?2 era isso ? não. o 'certo' é: http://localhost/?a=2 (por exemplo) Link to comment Share on other sites More sharing options...
17S17 Posted May 25, 2008 at 07:59 PM Author Report Share #187448 Posted May 25, 2008 at 07:59 PM sim era isso http://localhost/?a=2 como posso fazer isso ? Link to comment Share on other sites More sharing options...
pedrotuga Posted May 25, 2008 at 08:29 PM Report Share #187452 Posted May 25, 2008 at 08:29 PM sim era isso http://localhost/?a=2 como posso fazer isso ? Não percebo bem essa pergunta. Mas se tiveres um script php na raíz do htdocs chamado exemplo.php e esse script tiver este conteudo <?php echo $_GET["a"]; ?> se acederes ao url http://localhost/exemplo.php?a=3 verás um 3 no teu browser. Não sei explicar mais detalhadamente que isto. Link to comment Share on other sites More sharing options...
psiico Posted May 25, 2008 at 11:07 PM Report Share #187487 Posted May 25, 2008 at 11:07 PM fazes assim: <?php $page = ""; if(isset($_GET["a"])) $page=$_GET["a"]; if($page=="") $page=0; switch ($page) { case 'agenda': include 'agenda.php'; break; case 'kkercoisa': include 'kkercoisa.php'; break } Psiico // Portfolio Link to comment Share on other sites More sharing options...
pedrosorio Posted May 26, 2008 at 06:31 AM Report Share #187496 Posted May 26, 2008 at 06:31 AM Ou então vais a: http://www.w3schools.com/php/default.asp ou http://hudzilla.org/phpwiki/index.php?title=Main_Page ou http://www.php.net Não respondo a dúvidas por mensagem. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now