Jump to content
php.lv forumi
  • 0

FancyBox


eT`

Question

Mēģinu fancybox'ā ielādēt PHP failu, kurš atkarībā no URL attēlotu informāciju.

 

Lappušu ielādēšana

 

<?php
$p = explode('/',$_SERVER['REQUEST_URI']);
if($p[1] == '') $p[1] = 'index';

$neattelot = array('getinfo');

if(in_array($p[1],$neattelot))
{
  	include_once('pages/'.$p[1].'.php');// sho vajag dažām lapām bez headeriem etc.
}
else
{
visa lapas HTML daļa...
   $("a.upp").fancybox({
   'transitionIn' : 'elastic',
   'transitionOut' : 'elastic',
   'speedIn' : 600,
   'speedOut' : 200,
   'overlayShow' : false
   });

   <a class="upp" href="http://manalapa.lv/getinfo/a">CLICK ME</a>
}
?>

 

un /pages/getinfo.php

 


<?php
if(isset($p[2]))
{
switch($p[2])
{
case 'a':
echo '...';
break;

case 'b':
echo '...';
break;

case 'c':
echo '...';
break;
}
}
?>

 

bet FancyBox parāda - The requested content cannot be loaded. Please try again later.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

[color=#000000]include_once[/color][color=#666600]([/color][color=#008800]'pages/'[/color][color=#666600].[/color][color=#000000]$p[/color][color=#666600][[/color][color=#006666]1[/color][color=#666600]].[/color][color=#008800]'.php'[/color][color=#666600]);[/color][color=#880000]// sho vajag dažām lapām bez headeriem etc.[/color]

 

Pamēģini uzlikt, lai viņš ņem pēc pilnās, t.i. no root foldera.

Edited by vertex
Link to comment
Share on other sites

Join the conversation

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

Guest
Answer this question...

×   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...