NetHelp
It is currently Fri Sep 10, 2010 7:42 pm

| |



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Probleme Variabilele $_GET
New postPosted: Sun Feb 21, 2010 1:28 pm 
Vizitator

Joined: Sun Feb 21, 2010 1:18 pm
Posts: 3
In primu rand vreau sa va salut pe toti useri acestui forum.
Am si eu o mica problema sunt incepator in php si doresc sa fac un site care sa arate in felu urmator http://site.com/index.php?page=contact
Si sa dau si un exemplu sa intalege-ti mai bine "http://www.htcromania.ro/?page=acc"


Offline
 Profile E-mail  
 
 Post subject: Re: Probleme Variabilele $_GET
New postPosted: Sun Feb 21, 2010 3:46 pm 
Site Admin
User avatar

Joined: Tue Jul 21, 2009 4:08 pm
Posts: 132
Location: Cluj Napoca
Problema care e? :)

_________________
» Utilizare dig pentru debugging DNS
» Crawler in Perl


Offline
 Profile E-mail  
 
 Post subject: Re: Probleme Variabilele $_GET
New postPosted: Sun Feb 21, 2010 3:58 pm 
Vizitator

Joined: Sun Feb 21, 2010 1:18 pm
Posts: 3
Nu stiu sa fac aia, cu $_GET

Am incercat ceva in genu

<?php
if ($_GET['page'] == contact)
include ('contact.php');
else
echo "aaa!";

?>
Dar nu e ca acolo


Offline
 Profile E-mail  
 
 Post subject: Re: Probleme Variabilele $_GET
New postPosted: Mon Feb 22, 2010 12:44 pm 
Site Admin
User avatar

Joined: Tue Jul 21, 2009 4:08 pm
Posts: 132
Location: Cluj Napoca
Presupun ca if ($_GET['page'] == contact) e de fapt if ($_GET['page'] == "contact") (cu ghilimele). Daca da, codul e corect. Trebuie sa functioneze.

Fisierul contact.php contine si cod PHP? Daca da, incearca sa incluzi un fisier fara cod PHP si vezi ce se intampla - poate e ceva ce nu-i place in contact.php.

_________________
» Utilizare dig pentru debugging DNS
» Crawler in Perl


Offline
 Profile E-mail  
 
 Post subject: Re: Probleme Variabilele $_GET
New postPosted: Mon Feb 22, 2010 1:08 pm 
Vizitator

Joined: Sun Feb 21, 2010 1:18 pm
Posts: 3
Am reusit pana la urma:P ceva in genu ziceam

<?php
if ($_GET['page'] == contact)
include ('contact.php');
elseif ($_GET['page'] == film)
include ('film.php');
elseif ($_GET['page'] == login)
include ('login.php');
elseif ($_GET['page'] == admin)
include ('admin.php');
else
include ('home.php');
?>


Offline
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

| |

 Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
 
cron