[ Sandin @ 27.09.2008. 16:53 ] @
Parse error: syntax error, unexpected '?' in /home/xxxxx/public_html/sivo/details.php on line 8

Citat:

<?


if (!eregi("index.php", $_SERVER["PHP_SELF"])) {
die ("You can't access this file directly...");
}

eval ("<form action=\""<?php echo $_SERVER['PHP_SELF']; ?>"\" method=\"post\">");


$index = 1;


include("header.php");
global $link,$prefix,$map,$site_path;
echo"<br>";


evo dio koda ne znam dje sam pogrijesio nikako mi nece nema sta nisampokuso :S
[ Jezdimir Lončar @ 27.09.2008. 17:23 ] @
http://php.net/eval
Probaj ovako:
Code:

<?
if (!eregi("index.php", $_SERVER["PHP_SELF"])) {
die ("You can't access this file directly...");
}
echo "<form action=\"".$_SERVER['PHP_SELF']."\" method=\"post\">";


$index = 1;


include("header.php");
global $link,$prefix,$map,$site_path;
echo"<br>";
?>


EDIT.
Evo ako mora preko eval:
Code:

<?
if (!eregi("index.php", $_SERVER["PHP_SELF"])) {
die ("You can't access this file directly...");
}
eval("echo \"<form action='{$_SERVER['PHP_SELF']}' method='post'>\";");


$index = 1;

include("header.php");
global $link,$prefix,$map,$site_path;
echo"<br>";
?>
[ Nemanja Avramović @ 27.09.2008. 17:23 ] @
Ne znam zašto tu javlja grešku, ali u tom slučaju uopšte nije potrebno koristiti eval već običan echo:

Code:
echo "<form action=\"" . $_SERVER['PHP_SELF'] . "\" method=\"post\">";


I da, "global" se koristi samo unutar funkcije.

izmena: Jezdimir i ja smo pisali u isto vreme.
[ Sandin @ 27.09.2008. 17:30 ] @
da hvala vam decki, iso sam sa echo, ali evo opet mi javlja drugu gresku :S

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/xxxxx/public_html/sivo/details.php on line 128

evo copy koda od linije 126 pa do 174 jednostavno ne mogu naci u cemu je problem :S

Code:

echo"
<table width=\"412\" height=\"335\" align=\"center\">
  <tr>
    <td width=\"145\" height=\"28\"><span class="style3">Adresa:</span></td>
    <td width=\"257\"><span class="style4">$addr</span></td>
  </tr>
  <tr>
    <td><span class="style3">Telefon:</span></td>
    <td><span class="style4">$phone</span></td>
  </tr>
  <tr>
    <td><span class="style3">Mobitel:</span></td>
    <td><span class="style4">$mobile</span></td>
  </tr>
  <tr>
    <td><span class="style3">Fax:</span></td>
    <td><span class="style4">$fax</span></td>
  </tr>
  <tr>
    <td><span class="style3">Kanton:</span></td>
    <td><span class="style4">$state</span></td>
  </tr>
  <tr>
    <td><span class="style3">Grad:</span></td>
    <td><span class="style4">$city</span></td>
  </tr>
  <tr>
    <td><span class="style3">Država:</span></td>
    <td><span class="style4">$country</span></td>
  </tr>
  <tr>
    <td><span class="style3">Poštanski broj:</span></td>
    <td><span class="style4">$postcode</span></td>
  </tr>
  <tr>
    <td><span class="style3">e-Mail:</span></td>
    <td><span class="style4">$email</span></td>
  </tr>
  <tr>
    <td><span class="style3">Website:</span></td>
    <td><span class="style4">$website</span></td>
  </tr>
  <tr>
    <td><span class="style3">Mapa:</span></td>
    <td><a href=\"http://www.mapquest.com/maps/map.adp?country=".urlencode($country)."&address=".urlencode($addr)."&city=".urlencode($city)."&state=".urlencode($state)."&zipcode=$postcode&submit=Get+Map\"; class="style4"
>Get Map</a></td>
  </tr>
</table>";
}
[ Jezdimir Lončar @ 27.09.2008. 17:31 ] @
Imas:
Code:
<td width=\"257\"><span class="style4">$addr</span></td>

Probaj:
Code:
<td width=\"257\"><span class=\"style4\">$addr</span></td>

Isto i za ostale linije...

@Nemanja, da :) Ni ja nisam skontao za sta ce mu eval..
@Sandin, sintaksne greske su ti najlakse za resavanje.. Samo malo pogledaj malo tu liniju i koristi neki editor sa Syntax Highlightingom..
[ Sandin @ 27.09.2008. 17:39 ] @
pa to mi ej doslo tako u kodu, ali eto rijesio sam to, btw bili mi mogao preporuciti kakav dobar editor Syntax Highlightingom da se nemucim vise s tim, inace radim u dreamweaveru cs3 pa mi ne pokazuje bas puno :S
[ Jezdimir Lončar @ 27.09.2008. 17:45 ] @
I ja kodiram u Dreamweaver CS3, i on ima Syntax Highlighting.
Za PHP, HTML, CSS.........
Elem, za nesta ozbiljnije Zend Studio definitivno.
Evo vidi razliku, kad stavis \" i samo ", kako ti "izlazi" iz echo funkcije.
[att_img]
[ Sandin @ 27.09.2008. 17:47 ] @
aha, hvala na pojasnjenju jer nisam znao da je to to :( hehe ako budem kakvi jos problema imao uvezano za ovo javim se, hvala puno
[ Jezdimir Lončar @ 27.09.2008. 17:49 ] @
Np.
Jos da dodam da mozes da koristis echo ' (sa jednim ' a ne sa dva - "), pa ti tako nece "izlaziti" iz echo funkcije.
Pogledaj FAQ da vidis razliku izmedju " i '.
[ Sandin @ 27.09.2008. 17:51 ] @
Citat:
Sandin: aha, hvala na pojasnjenju jer nisam znao da je to to :( hehe ako budem kakvi jos problema imao uvezano za ovo javim se, hvala puno


evo nisam samo to odradio i to prode pa mi javlja ovo :S koja komplikaicja :S

Warning: include(themes//theme.php) [function.include]: failed to open stream: No such file or directory in /home/a9044121/public_html/sivo/header.php on line 10

Warning: include() [function.include]: Failed opening 'themes//theme.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/a9044121/public_html/sivo/header.php on line 10


Fatal error: Call to undefined function myheader() in /home/a9044121/public_html/sivo/header.php on line 22

evo kode od themp.php

Code:

<?php
function OpenTable() {
    echo "<table width=\"750\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"#FFFFFF\" align=\"center\"><tr><td>\n";
    echo "<table width=\"750\" border=\"0\" cellspacing=\"1\" cellpadding=\"8\" bgcolor=\"#FFFFFF\" align=\"center\"><tr><td>\n";
}

function CloseTable() {
    echo "</td></tr></table></td></tr></table>\n";
}

function myheader(){
    global $loginorout,$banner,$google;
 $tmpfile = "themes/paglax/header.html";
 if(empty($google)){
     $banner=$banner;
 }else{
     $banner=$google;
 }
 if(!file_exists($tmpfile)){
     die("File '$tmpfile' Not Found.");
 }
 $file = implode("", file($tmpfile));
 $file = addslashes($file);
 $file = "\$output=\"".$file."\";";
 eval($file);
 echo"$output";


}


function myfooter(){

 $tmpfile = "themes/paglax/footer.html";
 if(!file_exists($tmpfile)){
 die("File '$tmpfile' Not Found.");
 }
 $file = implode("", file($tmpfile));
 $file = addslashes($file);
 $file = "\$output=\"".$file."\";";
 eval($file);
 echo"$output";

}

function mysearch(){

 $tmpfile = "themes/paglax/search.html";
 if(!file_exists($tmpfile)){
 die("File '$tmpfile' Not Found.");
 }
 $file = implode("", file($tmpfile));
 $file = addslashes($file);
 $file = "\$output=\"".$file."\";";
 eval($file);
 echo"$output";

}

?>


uaa izvilenicu hehe

[ dakipro @ 27.09.2008. 17:52 ] @
Preporuka za Zend, ali o tome vec imas top temu tako da nije ovde tome mesto
[ Jezdimir Lončar @ 28.09.2008. 18:16 ] @
Citat:

Warning: include(themes//theme.php) [function.include]: failed to open stream: No such file or directory in /home/a9044121/public_html/sivo/header.php on line 10

Probaj da stavis:
Code:

<?php
require("themes/theme.php");
?>

Ova poruka gore ti znaci da si pogrijesio putanju.
[ Sandin @ 28.09.2008. 22:15 ] @
hvala puno si mi pomogo.. sad ne znam koliko je pametno pisati u istu temu ali imam sad problem koji sam ne znam rijesiti :S

da prvo pojasnim o cemu se radi, pravim web-biznis direktoriji i sad donekle sam ja to nes i zavrsio naso par skripti pa to kombiniram sad i ispo mi je problem u tomu kad nemogu da stavim ispod direktorija tj njegovog naziva u naslovnoj opis, koji sam naravno unjeo kad sam dodavo kategoriju to sad trenutno izgleda ovako...

Test(2) Gllupost(1) Proba(4)
... ... ...

borojevi u zagradama oznacavaju koliko se nalazi u tim kategorijama unosa i ispod su podkadtegorije te tri tackice (...) ali ja necu da pisu pod kategorije vec da pise opis kategorija.. uglavnom evo kod od mog viewdir.php pa ako moze neko da pogleda i da mi objasni sta treba da samo zamjenim znam da trebam samo zamijeniti nesto ali ne mogu ga naci :S

Code:

 <?


if (!eregi("index.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}


$index = 1;

include("header.php");
global $prefix, $link,$banner;

$cid=getvarint("cid");
//$findtot=mysql_query("select * from yp_list where cid=$cid", $link);
//$totallist=mysql_num_rows($findtot);
// This cause some problem
$sql=mysql_query("SELECT count(yp_list.listid)  AS total, count(yp_cat.cid) as totalcat  FROM yp_list LEFT JOIN yp_cat ON yp_list.cid = yp_cat.cid WHERE yp_list.cid =yp_cat.cid AND yp_cat.parentid='$cid' or yp_cat.cid ='$cid' AND active='1'",$link) or die("Error".mysql_error());
list($totallist,$totalcat)=mysql_fetch_row($sql);

$result = mysql_query("select title,parentid from yp_cat where cid=$cid", $link);
list($title,$parentid)=mysql_fetch_row($result);
$title=getparentlink($parentid,$title);
//openTable();
//echo"<tr><td align=center>$banner</td></tr>";
//closeTable();
//echo"<br>";

//update hits
@mysql_query("UPDATE  ".$prefix."_cat SET hits=hits+1 WHERE cid=$cid",$link);


echo"<div align=\"center\">
  <center>
  <table cellpadding=\"5\" border=\"0\" width=\"750\">
    <tr align=\"center\">
      <td valign=\"middle\" align=\"left\">
      <p align=\"left\"><b>::&nbsp;<a href=index.php>Početna</a>&nbsp;&nbsp;<strong><big>»</big></strong>&nbsp;$title($totallist)</b></td>
    </tr>
    <tr align=\"center\">
      <td align=\"center\">";
//working on it
  $resulta=@mysql_query("select listname FROM ".$prefix."_list  JOIN ".$prefix."_cat ON  ".$prefix."_list.cid= ".$prefix."_cat.cid  WHERE    ".$prefix."_cat.cid='$cid' AND active='1'",$link);
  while($al=@mysql_fetch_array($resulta)){
    $alphalist[]=strtolower(substr("$al[listname]",0,1));

  }
  echo"<table align=center>";
  echo"<tr><td><a href=\"index.php?file=viewdir&amp;cid=$cid\"><b>Sve</b></a>&nbsp;&nbsp;";
  foreach($alpha as $value){
      if(is_array($alphalist) && in_array(strtolower($value),$alphalist)){
        echo"<a href=\"index.php?file=viewdir&amp;cid=$cid&amp;startwith=$value\"><b>$value</b></a>&nbsp;&nbsp;";
      }else{
        echo"$value&nbsp;&nbsp;";
      }
  }


  echo"</td></tr>";
  echo"</table>";
  closeTable();

echo"<hr noshade=\"noshade\" color=\"#ff9933\" size=\"1\"></td>
</tr>
</table>
</center>
</div>";


$result2 = mysql_query("SELECT yp_cat.cid,title, count(listid) as totallist  FROM yp_cat LEFT  JOIN yp_list ON yp_list.cid = yp_cat.cid WHERE parentid = $cid AND active='1' GROUP  BY yp_cat.cid", $link) or die("Error".mysql_error());
$count = 1;
$csub=mysql_num_rows($result2);

echo"<div align=\"center\">";
echo"<table border=\"0\" width=80%>";
echo"<tr>";
while($row=@mysql_fetch_array($result2)){
echo"<td width=\"5%\">&nbsp;</td><td><a href=\"index.php?file=viewdir&amp;cid=$row[cid]\">$row[title]</a>($row[totallist])</td><td width=\"5%\">&nbsp;</td>";
if($count==3){
    echo"</tr></tr>";
    $count=0;
 }
$count++;
}
echo"</tr>";
echo"</table>";
echo"</div>";
closeTable();

if(isset($_GET["startwith"])){
    $startwith=addslashes($_GET["startwith"]);
}else{
    $startwith="";
}
if(!empty($_GET["startwith"])){
    $con= "substring(listname FROM 1 FOR 1)  LIKE '%$startwith%'  AND";
}else{
    $con="";
}

$query="select listid,cid,listname,description FROM ".$prefix."_list where $con  cid=$cid AND active='1'";

$resultc=mysql_query("$query", $link) or die("Error".mysql_error());
$num_record = mysql_num_rows($resultc);


if($num_record<1){
    openTable();
    echo"<center>"._YPNORECORDFOUND."</center>";
    closeTable();
    include("footer.php");
    exit;
}

if(isset($_GET['page']))
$page=intval($_GET['page']);
else $page=1;

$currentpage=$page;

$perpage =10;
$start=($page-1) * $perpage;
$pages=ceil($num_record/$perpage);

$starting_no = $start + 1;

if ($num_record - $start<$perpage) {
   $end_count = $num_record;
} elseif ($num_record - $start >= $perpage) {
   $end_count = $start + $perpage;
}

if($pages>1)
$page_link = makepagelink("index.php?file=viewdir&cid=$cid&startwith=$startwith", $page, $pages);
else
$page_link = "";


$result=@mysql_query("select listid,cid,phone,listname,description,city,country,website from yp_list where  $con  cid=$cid limit $start,$perpage", $link);

if($num_record>0){
echo"<div align=\"center\">";
echo"<table cellSpacing=0 cellPadding=0 width=75% border=0>
  <tr>
    <td colSpan=3><hr color=#ff9933 noShade SIZE=1></td>
  </tr>
  <tr>
    <td vAlign=top align=left>
    <p align=left>Prikazano » :
   $starting_no-$end_count od $num_record unosa » Stranica $currentpage</td>
    <td width=20>&nbsp;</td>
    <td vAlign=top align=right>
    <p align=right>";
    echo"$page_link";
   echo"</td>
  </tr>
  <tr>
    <td colSpan=3><hr color=#ff9933 noShade SIZE=1></td>
  </tr>
</table>";
echo"</div>";

echo "<div align=center>
  <center>
  <table cellPadding=5 width=75% border=0>
    <tr>
      <td vAlign=top align=right width=7% bgColor=#ffd966>
      <strong>Broj.</strong></td>
      <td vAlign=top align=left width=45% bgColor=#ffd966>
      <strong>Organizacija&nbsp;&nbsp; </strong></td>
      <td vAlign=top align=left width=25% bgColor=#ffd966 >
      <strong>Grad</strong></td>
      <td vAlign=top align=left width=15% bgColor=#ffd966>
      <strong>Država</strong></td>
      <td vAlign=top align=middle width=8% bgColor=#ffd966 >
      <strong>Web stranica</strong></td>
    </tr>
  </table>
  </center>
</div>";
$num=$starting_no-1;
while(list($listid,$cid,$phone,$listname,$description,$city,$country,$website)=mysql_fetch_row($result)) {
$title = stripslashes($title);
$description = stripslashes($description);
$num++;
if($website="<a href=\"$website\" target=\"_blank\"><img alt=\"Posjetite $listname web stranicu\" src=\"images/homepage.gif\" border=\"0\" width=19 height=19></a>";

}
}
if(strlen($phone)<3){
$phone="";
}else{
$phone="($phone)";
}


$country=country($country);

echo"<div align=center>
  <center>
  <table cellPadding=5 width=75% border=0>
    <tr>
      <td vAlign=top align=right width=7% bgColor=#ffe699>
      $num</td>
      <td vAlign=top align=left width=45% bgColor=#ffe699>

      <a href=\"index.php?file=details&amp;listid=$listid&amp;cid=$cid\">
      $listname</a> <br>$phone</td>
      <td vAlign=top align=left width=25% bgColor=#ffe699>
      $city</td>
      <td vAlign=top align=left width=15% bgColor=#ffe699>
      $country</td>
      <td vAlign=top align=middle width=8% bgColor=#ffe699>$website</td>
    </tr>
  </table>
  </center>
</div>";




echo"<br>";
if($num_record>0){
echo"<div align=\"center\">";
echo"<table cellSpacing=0 cellPadding=0 width=75% border=0>
  <tr>
    <td colSpan=3><hr color=#ff9933 noShade SIZE=1></td>
  </tr>
  <tr>
    <td vAlign=top align=left>
    <p align=left>Prikazano » :
   $starting_no-$end_count od $num_record unosa » Strana $currentpage</td>
    <td width=20>&nbsp;</td>
    <td vAlign=top align=right>
    <p align=right>";
    echo"<a href=#top>Vrh</a>&nbsp;$page_link";
   echo"</td>
  </tr>
  <tr>
    <td colSpan=3><hr color=#ff9933 noShade SIZE=1></td>
  </tr>
    </table>";
    echo"</div>";
}

include("footer.php");

?>