PDA

View Full Version : Strange code appears in Firefox but not Safari


jessa
01-30-2009, 02:00 AM
Hi All,

There is some strange code appearing on my site in Firefox but it looks correct in Safari. Here is the site on my testing server: http://deptart2.memphis.edu/~jwilcoxen/web_portfolio/portfolio.php

Here is the code:

This is what the code says:
<% FilterParam = cat_rs.Fields.Item("cat_title").Value project_rs.Filter = "project_id = " & FilterParam While (NOT project_rs.EOF) %> <%=(project_rs.Fields.Item("image_thumb").Value)%>, <% project_rs.MoveNext() Wend %>

<% FilterParam = project_rs.Fields.Item("project_id").Value project_rs.Filter = "project_id = " & FilterParam While (NOT visual_rs.EOF) %> <%=(visual_rs.Fields.Item("image_large").Value)%> <% visual_rs.MoveNext() Wend %>
<br><br>

edbr
01-30-2009, 02:05 AM
post you raw code

jessa
01-30-2009, 01:24 PM
Sorry Here is the raw code:

<?php require_once('Connections/portfolio.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

$currentPage = $_SERVER["PHP_SELF"];

$maxRows_project_rs = 6;
$pageNum_project_rs = 0;
if (isset($_GET['pageNum_project_rs'])) {
$pageNum_project_rs = $_GET['pageNum_project_rs'];
}
$startRow_project_rs = $pageNum_project_rs * $maxRows_project_rs;

$colname_project_rs = "-1";
if (isset($_GET['cat_id'])) {
$colname_project_rs = $_GET['cat_id'];
}
mysql_select_db($database_portfolio, $portfolio);
$query_project_rs = sprintf("SELECT * FROM project WHERE cat_id = %s ORDER BY project_timestamp DESC", GetSQLValueString($colname_project_rs, "int"));
$query_limit_project_rs = sprintf("%s LIMIT %d, %d", $query_project_rs, $startRow_project_rs, $maxRows_project_rs);
$project_rs = mysql_query($query_limit_project_rs, $portfolio) or die(mysql_error());
$row_project_rs = mysql_fetch_assoc($project_rs);

if (isset($_GET['totalRows_project_rs'])) {
$totalRows_project_rs = $_GET['totalRows_project_rs'];
} else {
$all_project_rs = mysql_query($query_project_rs);
$totalRows_project_rs = mysql_num_rows($all_project_rs);
}
$totalPages_project_rs = ceil($totalRows_project_rs/$maxRows_project_rs)-1;

$maxRows_visual_rs = 1;
$pageNum_visual_rs = 0;
if (isset($_GET['pageNum_visual_rs'])) {
$pageNum_visual_rs = $_GET['pageNum_visual_rs'];
}
$startRow_visual_rs = $pageNum_visual_rs * $maxRows_visual_rs;

$colname_visual_rs = "-1";
if (isset($_GET['project_id'])) {
$colname_visual_rs = $_GET['project_id'];
}
mysql_select_db($database_portfolio, $portfolio);
$query_visual_rs = sprintf("SELECT * FROM visual WHERE project_id = %s ORDER BY visual_timestamp ASC", GetSQLValueString($colname_visual_rs, "int"));
$query_limit_visual_rs = sprintf("%s LIMIT %d, %d", $query_visual_rs, $startRow_visual_rs, $maxRows_visual_rs);
$visual_rs = mysql_query($query_limit_visual_rs, $portfolio) or die(mysql_error());
$row_visual_rs = mysql_fetch_assoc($visual_rs);

if (isset($_GET['totalRows_visual_rs'])) {
$totalRows_visual_rs = $_GET['totalRows_visual_rs'];
} else {
$all_visual_rs = mysql_query($query_visual_rs);
$totalRows_visual_rs = mysql_num_rows($all_visual_rs);
}
$totalPages_visual_rs = ceil($totalRows_visual_rs/$maxRows_visual_rs)-1;

mysql_select_db($database_portfolio, $portfolio);
$query_cat_rs = "SELECT * FROM category ORDER BY cat_id ASC";
$cat_rs = mysql_query($query_cat_rs, $portfolio) or die(mysql_error());
$row_cat_rs = mysql_fetch_assoc($cat_rs);
$totalRows_cat_rs = mysql_num_rows($cat_rs);

$colname_projectdetail_rs = "-1";
if (isset($_GET['project_id'])) {
$colname_projectdetail_rs = $_GET['project_id'];
}
mysql_select_db($database_portfolio, $portfolio);
$query_projectdetail_rs = sprintf("SELECT * FROM project WHERE project_id = %s", GetSQLValueString($colname_projectdetail_rs, "int"));
$projectdetail_rs = mysql_query($query_projectdetail_rs, $portfolio) or die(mysql_error());
$row_projectdetail_rs = mysql_fetch_assoc($projectdetail_rs);
$totalRows_projectdetail_rs = mysql_num_rows($projectdetail_rs);

$queryString_visual_rs = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_visual_rs") == false &&
stristr($param, "totalRows_visual_rs") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_visual_rs = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_visual_rs = sprintf("&totalRows_visual_rs=%d%s", $totalRows_visual_rs, $queryString_visual_rs);

// lucas put this here to get the category id of the current category
$getthecat = $_GET['cat_id'];
$getthenum = $_GET['pageNum_project_rs'];
$getthetotal = $_GET['totalRows_project_rs'];
//


$queryString_project_rs = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_project_rs") == false &&
stristr($param, "totalRows_project_rs") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_project_rs = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_project_rs = sprintf("&totalRows_project_rs=%d%s", $totalRows_project_rs, $queryString_project_rs);


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Jessa Wilcoxen's Portfolio</title>
<style type="text/css">
<!--
body {
background-color: #000000;
background-image: url(images/bg2.jpg);
margin-left: 0px;
margin-top: 0px;
background-repeat: no-repeat;
}
-->
</style>
<link href="global.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<style type="text/css">
<!--
.style2 {
color: #4F285B
}
a:link {
text-decoration: none;
color: #4F285B;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
.style3 {
color: #4F285B
}
-->
</style>
</head>
<body onload="MM_preloadImages('images/home_button_glow.gif')">
<div id="wrapper">
<div id="logo"><a href="index.php"><img src="images/logo_glow.jpg" alt="logo" width="265" height="133" border="0" /></a></div>
<div id="name">
<div align="right"><img src="images/name.jpg" alt="jessa wilcoxen graphic designer" width="361" height="40" /></div>
</div>
<div id="portfolio_holder">
<%
FilterParam = cat_rs.Fields.Item("cat_title").Value
project_rs.Filter = "project_id = " & FilterParam
While (NOT project_rs.EOF)
%>
<%=(project_rs.Fields.Item("image_thumb").Value)%>,&nbsp;
<%
project_rs.MoveNext()
Wend
%>
<div id="catagory">
<?php do { ?>
<div id="category_inside"><a href="portfolio.php?cat_id=<?php echo $row_cat_rs['cat_id']; ?>"><?php echo $row_cat_rs['cat_title']; ?></a></div>
<?php } while ($row_cat_rs = mysql_fetch_assoc($cat_rs)); ?>
</div>
<div id="portfolio_content">
<%
FilterParam = project_rs.Fields.Item("project_id").Value
project_rs.Filter = "project_id = " & FilterParam
While (NOT visual_rs.EOF)
%>
<%=(visual_rs.Fields.Item("image_large").Value)%>&nbsp;
<%
visual_rs.MoveNext()
Wend
%>
<div id="big_image">
<?php do { ?>
<?php if ($totalRows_visual_rs > 0) { // Show if recordset not empty ?>
<img src="images/projects/<?php echo $row_visual_rs['image_large']; ?>" width="470" height="300" border="0"/>
<?php } // Show if recordset not empty ?>
<?php } while ($row_visual_rs = mysql_fetch_assoc($visual_rs)); ?>
</div>
<div id="portfolio_text">
<p><span class="content_heading"><?php echo $row_projectdetail_rs['title_text']; ?></span></p>
<p><span class="content_heading">
<?php if ($totalRows_project_rs > 0) { // Show if recordset not empty ?>
<?php if ($pageNum_project_rs > 0) { // Show if not first page ?>
<?php echo $row_project_rs['project']; ?>
<?php } // Show if not first page ?>

<?php } // Show if recordset not empty ?>
</span> <?php echo $row_projectdetail_rs['project_text']; ?></p>
<p><span class="content_heading">
<?php if ($totalRows_project_rs > 0) { // Show if recordset not empty ?>
<?php echo $row_projectdetail_rs['solution']; ?>
<?php } // Show if recordset not empty ?>
</span> <?php echo $row_projectdetail_rs['solution_text']; ?></p>
<p class="style2"><a href="<?php echo $row_projectdetail_rs['web_link']; ?>" target="_blank"><?php echo $row_projectdetail_rs['web_link']; ?></a></p>
</div>
<div id="little_image">
<?php do { ?>
<a href="portfolio.php?project_id=<?php echo $row_project_rs['project_id']; ?>&cat_id=<?php echo $getthecat ?><?php if (isset($_GET['pageNum_project_rs'])) { ?>&pageNum_project_rs=<?php echo $getthenum ?><?php } ?><?php if (isset($_GET['totalRows_project_rs'])) { ?>&totalRows_project_rs=<?php echo $getthetotal ?><?php } ?>">
<?php if ($totalRows_project_rs > 0) { // Show if recordset not empty ?>
<img src="images/projects/<?php echo $row_project_rs['image_thumb']; ?>" alt="<?php echo $row_project_rs['title_text']; ?>" width="30" height="30" vspace="5" border="0"/>
<?php } // Show if recordset not empty ?>
</a><br />
<?php } while ($row_project_rs = mysql_fetch_assoc($project_rs)); ?>
</div>
<div id="arrows"> <a href="<?php printf("%s?cat_id=$getthecat&pageNum_project_rs=%d%s", $currentPage, max(0, $pageNum_project_rs - 1), $queryString_project_rs); ?>">
<?php if ($pageNum_project_rs > 0) { // Show if not first page ?>
<img src="images/arrow_up.gif" alt="up" width="13" height="28" border="0" />
<?php } // Show if not first page ?>
</a> <a href="<?php printf("%s?cat_id=$getthecat&pageNum_project_rs=%d%s", $currentPage, min($totalPages_project_rs, $pageNum_project_rs + 1), $queryString_project_rs); ?>">
<?php if ($pageNum_project_rs < $totalPages_project_rs) { // Show if not last page ?>
<img src="images/arrow_down.gif" alt="next" width="15" height="30" border="0" />
<?php } // Show if not last page ?>
</a> </div>
<div id="numbers_display"><?php echo ($startRow_project_rs + 1) ?> - <?php echo min($startRow_project_rs + $maxRows_project_rs, $totalRows_project_rs) ?></div>
<div id="additional_images">
<?php for ($i=0; $i <= $totalPages_visual_rs; $i++) { $TFM_PagesEndCount = $i + 1; if($i != $pageNum_visual_rs) { printf('<a href="'."%s?pageNum_visual_rs=%d%s", $currentPage, $i, $queryString_visual_rs.'">'.$TFM_PagesEndCount."</a>"); }else{ echo("<strong>$TFM_PagesEndCount</strong>"); } if($i != $totalPages_visual_rs) echo(" ");} ?>
</div>
</div>
</div>
<div id="footer_portfolio"><a href="home.php" class="style3"><img src="images/home_button.gif" alt="home" width="114" height="35" border="0" id="Image1" onmouseover="MM_swapImage('Image1','','images/home_button_glow.gif',1)" onmouseout="MM_swapImgRestore()" /></a></div>
</div>
</div>
</div>
<script type="text/javascript">
<!--

//-->
</script>
</body>
</html>
<?php
mysql_free_result($project_rs);

mysql_free_result($visual_rs);

mysql_free_result($cat_rs);

mysql_free_result($projectdetail_rs);
?>

edbr
01-31-2009, 01:52 AM
DW inserted this code?
<%
FilterParam = project_rs.Fields.Item("project_id").Value
project_rs.Filter = "project_id = " & FilterParam
While (NOT visual_rs.EOF)
%>
<%=(visual_rs.Fields.Item("image_large").Value)%>&nbsp;
<%
visual_rs.MoveNext()
Wend
%>

jessa
01-31-2009, 09:03 PM
That is the code that appears on my website when I view in in Firefox. It is not there is Safari and I don't know why.

edbr
02-02-2009, 01:51 AM
i dont recognise this it , it does not look like php to me . i would comment it out and see what happens

jessa
02-02-2009, 03:48 AM
What do you mean "comment it out"? I'm still new to all of web coding terms.

domedia
02-02-2009, 04:02 AM
All languages, afaik, have a way of inserting comments.
<!-- This is an HTML comment -->

depilator
02-04-2009, 01:41 PM
<% FilterParam = cat_rs.Fields.Item("cat_title").Value project_rs.Filter = "project_id = " & FilterParam While (NOT project_rs.EOF) %> <%=(project_rs.Fields.Item("image_thumb").Value)%>, <% project_rs.MoveNext() Wend %>

<% FilterParam = project_rs.Fields.Item("project_id").Value project_rs.Filter = "project_id = " & FilterParam While (NOT visual_rs.EOF) %> <%=(visual_rs.Fields.Item("image_large").Value)%> <% visual_rs.MoveNext() Wend %>

it looks like ASP code

I found in Your div id="portfolio_holder" and div id="portfolio_content" this code. It may be a code from some template or from web page