Jump to content
php.lv forumi

Recommended Posts

Posted (edited)
<a href="?id=1"><img src="kl.gif"/></a>
<a href="?id=2"><img src="ts.gif"/></a>
<a href="?id=2"><img src="ad.gif"/></a>
<?php
$id = isset($_GET["id"]) ? intval($_GET["id"]) : 1;
if ($id == 1)
{
	echo "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy";
}
else if ($id == 2)
{
	echo "jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj";
}
else if ($id == 3)
{
	echo "teksts, kad 3";
}
else
{
	echo "ERROR, nepareizs id";
}
?>

Edited by Puika1
Posted (edited)

piemēram

 

<a href="?id=1"><img src="kl.gif"/></a>
<a href="?id=2"><img src="ts.gif"/></a>
<a href="?id=2"><img src="ad.gif"/></a>
<?php
$id = isset($_GET["id"]) ? intval($_GET["id"]) : 1;
if ($id == 1)
{
	echo "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy";
}
else if ($id == 2)
{
	echo "jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj";
}
else if ($id == 3)
{
	echo "<?php include("kautkas"); ?>";
}
else
{
	echo "ERROR, nepareizs id";
}
?>

 

īstenība ko tur rādīt ja es teicu kad ielieku iekšā kko no php script vairs nestrādā

 

piemēram šitas varians ko es tiko uzrakstiju ejot iekšā rāda eror

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\AppServ\www\cel.php on line 16

Edited by Puika1
Posted

Uzreiz šito vajadzēja :)

Vispār tev vajadzētu pamācīties php pamatus.

 

echo izvada, include iekļauj, <?php uzsāk php kodu.

// ...
}elseif($id==3){
	include("kautkas");
}
// ...

Posted (edited)

kā es sapratu pēc tava teiktā izskatās tā

 

<a href="?id=1"><img src="kl.gif"/></a>
<a href="?id=2"><img src="ts.gif"/></a>
<a href="?id=2"><img src="ad.gif"/></a>
<?php
$id = isset($_GET["id"]) ? intval($_GET["id"]) : 1;
if ($id == 1)
{
	"<?php include("kautkas"); ?>";
}
}elseif($id==3){
	include("kautkas");
{
   }elseif($id==3){
	include("kautkas");
}
else if ($id == 3)
{
 }elseif($id==3){
	include("kautkas");;
}
else
{
	echo "ERROR, nepareizs id";
}
?>

 

bet nestrādā

Parse error: syntax error, unexpected T_STRING in C:\AppServ\www\cel.php on line 8

Edited by Puika1
Posted (edited)

beidzot man sanāca

 

bet man rāda šitā

1233513231.JPG

 

kā var lai būtu apakšā

 

scripts

<a href="?id=1"><img src="kl.gif"/></a>
<a href="?id=2"><img src="ts.gif"/></a>
<a href="?id=3"><img src="ad.gif"/></a>
<?php
$id = isset($_GET["id"]) ? intval($_GET["id"]) : 1;
if ($id == 1)
{
   include("lapa/1.php");
}
else if ($id == 2)
{
   include("scr/serv.php");
}
else if ($id == 3)
{
   include("scr/xxx.php");
}
else
{
	echo "ERROR, nepareizs id";
}
?>

Edited by Puika1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...