I have a PHP script A which displays data from database.
I have another another script B which gets the content of script A .But I need the content after script A is executed . But this is not happending .
// Script A
enter code here
<?php
session_start();
if(!isset($_SESSION['username']))
{
print "You have not logged in";
header('Location: index.htm');
}
session_write_close();
?>
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv
="content-language" content="cs" />
<meta name="robots" content="all,follow" />
<meta name="author" content="All: ... [Nazev webu - www.url.cz]; e-mail: info#url.cz" />
<meta name="copyright" content="Design/Code: Vit Dlouhy [Nuvio - www.nuvio.cz]; e-mail: vit.dlouhy#nuvio.cz" />
<title>WAVES 1.0!</title>
<meta name="description" content="..." />
<meta name="keywords" content="..." />
<link rel="index" href="./" title="Home" />
<link rel="stylesheet" media="screen,projection" type="text/css" href="./css/main.css" />
<link rel="stylesheet" media="print" type="text/css" href="./css/print.css" />
<link rel="stylesheet" media="aural" type="text/css" href="./css/aural.css" />
<script type="text/javascript" src="js/jquery-1.2.6.pack.js"></script>
<script language="javascript" type="text/javascript">
function getQueryParams( val )
{
//Use the window.location.search if we don't have a val.
var query = val || window.location.search;
query = query.split('?')[1]
var pairs = query.split('&');
var retval = {};
var check = [];
for( var i = 0; i < pairs.length; i++ )
{
check = pairs[i].split('=');
retval[check[0]] = check[1];
}
return retval;
}
var values = getQueryParams();
var v = values['id'];
$(function()
{
$.getJSON("getviewresults.php?id="+v, function(data)
{
$.each(data, function(entryIndex, entry)
{
var name = entry['tid'];
var user = entry['status'];
var p= entry['description'];
var f = entry['time'];
var stime = entry['stime'];
$('<tr> <td>'+name+'</td> <td > '+p+'</td> <td> '+user+'</td> <td>'+f+'</td> <td> Log </td> <td>Device Log </td><td> LAN </td> </tr> ').appendTo('#container');
});
});
});
</script>
</head>
<body>
<!-- Main -->
<div id="main" class="box">
<!-- Header -->
<div id="header" style="left: 0px; width: 100%; top: 1px; height: 61px">
<!-- Logotyp -->
<h1 id="logo" style="left: 46px; top: 19px">WAVES 1.0!<strong>!</strong><span></span></h1>
<hr class="noscreen" />
<img src="Design/logo.jpg" style="right:0px; width: 134px; position: absolute;
top: -2px; height: 61px" />
</div> <!-- /header -->
<!-- Main menu (tabs) -->
<div id="tabs" class="noprint" style="width:100%; left: 0px; position: relative; top: 0px; height:24px">
<h3 class="noscreen">Navigation</h3>
<ul class="box">
<li>Home<span class="tab-l"></span><span class="tab-r"></span></li>
<li>Package<span class="tab-l"></span><span class="tab-r"></span></li>
<li >Configs<span class="tab-l"></span><span class="tab-r"></span></li>
<li>Live<span class="tab-l"></span><span class="tab-r"></span></li>
<li id="active">Results<span class="tab-l"></span><span class="tab-r"></span></li>
<li>Log out<span class="tab-l"></span><span class="tab-r"></span></li>
</ul>
<hr class="noscreen" />
</div> <!-- /tabs -->
<!-- Page (2 columns) -->
<!-- /page -->
<div style="border-right: #336699 thin solid; border-top: #336699 thin solid; left: 0px;
border-left: #336699 thin solid; width: 100%; border-bottom: #336699 thin solid;
position: relative; top: 0px; height: 480px; overflow:auto">
<table id="container" style="left: 0px; width:100%; position: relative; ">
<tr>
<td style="width: 100px">
<strong>Testid</strong></td>
<td style="width: 382px">
<strong>Description</strong></td>
<td style="width: 100px">
<strong>Status</strong></td>
<td style="width: 100px">
<strong>Time Taken</strong></td>
<td style="width: 100px">
<strong>Log </strong></td>
<td style="width: 100px">
<strong>Device Log </strong></td>
<td style="width: 100px">
<strong>LAN </strong></td>
</tr>
</table>
</div>
</div>
<!-- Footer -->
<!-- /footer -->
<!-- /main -->
</body>
</html>
// Script B
$ch = curl_init();
$url = "http://localhost/waves/viewresults.htm?id=".$id;
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);
chdir("temp/file");
$myFile = "summary.htm";
$fh = fopen($myFile, 'w') or die("can't open file");
fwrite($fh, $data);
fclose($fh);
The file summary.htm just has the code of the script A , which means it has not executed nnd hence has not data from the database .
What am I doing wrong ?
So I started to answer without reading your code but now see that you are using JavaScript to output the data from Script A instead of using PHP.
Why it wont work: You are dynamically creating a table at run time using client side JavaScript. This will render properly in a browser but will not render via curl. libcurl does not support javascript.
Suggested Solution
I would suggest that you modify getviewresults.php and follow this tutorial to buffer the output to a file or you could also optionally just rewrite Script A to use a server side script.
This was a really entertaining problem thank you.
Try renaming "viewresults.htm" to "viewresults.php" so it's parsed as PHP (you could use mod_rewrite to internally redirect viewresults.htm to viewresults.php so your URLs don't change).
Open the URL you're trying to get in your browser - i.e. http://localhost/waves/viewresults.htm?id=X (with correct value of X) - and see what content is output.
If you still see PHP code displayed in your browser then you know that the file is not being parsed as PHP. By default only filenames with .php on the end will be executed as PHP.
Also, I don't think the code in Script A is going to be executed properly anyway because the session variables won't be set.
Related
So, my html page has content going under the footer. Can someone help me make the page get longer
so that you can scroll down to see the footer? or make it so that the footer begins where content ends(prefered)? Not sure what i did wrong.
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<title>351 Project || Search Student Notes</title>
<link rel="stylesheet" href="main.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div id="wrapper">
<?php include "advisor_header.html" ?>
<div>
<h1>Student Notes For <?php echo $student_first_name . " " . $student_last_name;?> </h1>
<div>
<div>
<textarea class="chunkybox" disabled="disabled" name="notes" rows="20" col = "15"><?php echo $student_notes;?></textarea>
</div>
</div>
<h3><center>End of Notes</center></h3>
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="post">
<form name="activeadviseeform" class="centeredbutton">
<div>
<div>
<textarea style="height: auto;" class="chunkybox" name="notes" rows="20" col = "15" placeholder="Type notes to ADD"></textarea>
</div>
</div>
<button class="centeredbutton" type="submit">Add Notes</button>
</form>
<form action="advisor_edit_notes.php">
<button class="centeredbutton" type="submit">Edit Notes</button>
</form>
<?php if($_SERVER["REQUEST_METHOD"] == "POST"){
if ($student_notes == null) {
$appendednotes = $time . " " . $_POST['notes'];
}
if ($student_notes != null) {
$appendednotes = $student_notes . "\r\n" . $time . " " . $_POST['notes'];
}
$update = "UPDATE people SET notes = '$appendednotes' WHERE id = '$student_id'";
// update in database
$rs = mysqli_query($con, $update);
if($rs)
{
header("Refresh:0");
//printf("Notes Added to : %s Notes", $_SESSION["activeadvisee"]);
}
}
?>
</div>
</div>
<?php include "footer.html" ?>
</body>
</html>
footer.html:
<footer class='footer'>
Copyright © 2022 <br>
placeholder#temp.com :: Contact Form
</footer>
main.css:
.footer {
width: 100%;
height: 150px;
background: #3167b1;
position: fixed;
bottom: 0px; left: 0;
}
Position fixed may not be what you want from what it sounds like? Fixed would keep it on the page at all times with the scroll.
If you only want it to stay at the bottom I would think static is the position you would want - which is the default.
Is there something I'm misunderstanding?
https://www.w3schools.com/css/css_positioning.asp
position: fixed; An element with position: fixed; is positioned
relative to the viewport, which means it always stays in the same
place even if the page is scrolled. The top, right, bottom, and left
properties are used to position the element.
A fixed element does not leave a gap in the page where it would
normally have been located.
use any of the below
position: relative;
position: static;
.footer {
width: 100%;
height: 150px;
background: #3167b1;
position: relative;
bottom: 0px;
left: 0;
}
Try putting the footer.html code directly in your main PHP file after the </body> tag. also, have you added overflow attribute for making your page scrollable in the CSS file?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" DIR=ltr >
<head>
<title>MPage1</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="viewport" content="width=320,user-scalable=yes,initial-scale=1, minimum-scale=1, maximum-scale=1">
<script src="/rpcl-bin/jquerymobile/js/base64.js"></script>
<script src="/rpcl-bin/jquerymobile/js/jquery-1.6.1.min.js"></script>
<script src="/rpcl-bin/jquerymobile/js/functions.js"></script>
<script>
jQuery(document).bind('mobileinit', function(){
jQuery.noConflict();
jQuery.extend(jQuery.mobile , {
loadingMessage: 'Loading',
pageLoadErrorMessage: 'Error Loading Page',
autoInitialize: true,
defaultTransition: 'slide'
});
});</script>
<script src="/rpcl-bin/jquerymobile/js/jquery.mobile-1.0b1.js"></script>
<link rel="stylesheet" href="/rpcl-bin/jquerymobile/css/jquery.general.css" />
</head>
<body style=" margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; " >
<div data-role="page" id="MPage1_page" >
<link rel="stylesheet" href="/unit1.php?header_file=css" />
<script src="/unit1.php?header_file=js"></script>
<form style="margin-bottom: 0" id="MPage1" name="MPage1" method="post" target="_self" action="/unit1.php"><input type="hidden" name="serverevent" value=""><input type="hidden" name="serverparams" value="">
<table width="320" style="height:480px" border="0" cellpadding="0" cellspacing="0" ><tr><td valign="top">
<div id="ComboBox1_outer" style="Z-INDEX: 0; LEFT: 66px; WIDTH: 185px; POSITION: absolute; TOP: 82px; HEIGHT: 18px">
<select name="ComboBox1" id="ComboBox1" size="1" style=" font-family: ; font-size: ; cursor: default;height:16px;width:185px;" tabindex="0" > <option value="0" >value0</option>
<option value="1" selected="selected" >value1</option>
</select>
</div>
</td></tr></table>
</form></div>
</body>
</html>
<!-- MPage1 end -->
I've installed RadPHP XE2 on Windows 7 machine.
I've created a new mobile application and added a combobox to the form. I added 2 items (value0, value1) to the combobox and set the item index to 0.
When I run the application this the selected value is displayed above the combobox. This happens in IE and Chrome (latest version) How do I remove this?
EDIT: I've attached the downloaded HTML. Strange. When I save it to a .html file and open it in a browser, the page displays correctly, but running it from the IDE, it doesn't
I am trying to implement JQueryUI resizable. It's not working below is my tentative demo which I will implement later in actual code. Please help me to solve it. It's not working.
<head>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.8.20/themes/base/jquery-ui.css" type="text/css" media="all" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<style>
#resizable { width: 150px; height: 150px; padding: 0.5em; }
#resizable h3 { text-align: center; margin: 0; }
.ui-resizable-helper { border: 1px dotted gray; }
</style>
<script>
$(function() {
//var a = $("#resizable").html();
//alert(a);
$("#resizable").resizable();
});
</script>
</head>
<body>
<div id="demo-frame">
<meta charset="utf-8">
<div class="demo">
<div class="ui-widget-content ui-resizable" id="resizable">
<h3 class="ui-widget-header">Resizable</h3>
<div class="ui-resizable-handle ui-resizable-e" style="z-index: 1000;"></div>
<div class="ui-resizable-handle ui-resizable-s" style="z-index: 1000;"></div>
<div class="ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se" style="z-index: 1000;"></div>
</div>
</div>
</div>
</body>
It's the divs you have inside of your div that seem to be causing an issue. I commented them on on this jsFiddle http://jsfiddle.net/ta9N4/ and it appears to be working fine.
The method resizable() comes from jQuery UI API.
And you didn't include jQueryUI in your html page.
Go here to download it (or grab a link to this file), and include it like you did for jQuery (<script> tag).
It's me again - The code is working now, but I can't seem to be able to add a link to the '$info['name']' in the alt.
I want to be able to add links to the picture and the name. The picture link works, but the link does not appear in the name.
I may have some mistakes in the code below.
The link works on the picture but now in the alt.
Here's the code:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<title>JQuery Cycle Plugin - Pager Demo with Prev/Next Controls</title>
<link rel="stylesheet" type="text/css" media="screen" href="../jq.css" />
<link rel="stylesheet" type="text/css" media="screen" href="cycle.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script type="text/javascript" src="http://malsup.github.com/chili-1.7.pack.js"></script>
<script type="text/javascript" src="http://malsup.github.com/jquery.cycle.all.js"></script>
<style type="text/css">
#main { margin: 20px }
#nav { margin: 10px; position: relative }
#nav li { float: left; list-style: none}
#nav a { margin: 5px; padding: 3px 5px; border: 1px solid #ccc; background: #fc0; text-decoration: none }
#nav li.activeSlide a { background: #faa; color: black }
#nav a:focus { outline: none; }
</style>
<script type="text/javascript">
$(document).ready(function() {
$('#slideshow').cycle({
prev: '.prev', // Setup prev links
next: '.next', // Setup next links
pager: '.nav', // Setup pager navs
before: function () {
$("#name").html($(this).children("img").attr("alt"));
}
});
});
</script>
<style type="text/css">
#left, #slideshow, #right { float: left; width: 200px; }
</style>
</head>
<body>
<!-- left nav bar -->
<div id="left">
<span class="prev">Prev</span>
<span class="next">Next</span>
<ul class="nav"></ul>
</div>
<!-- slideshow -->
<div id="slideshow">
<?php
mysql_connect("localhost", "root", "")or die("cannot connect");
mysql_select_db($db_name)or die("cannot select DB");
$data = mysql_query("SELECT * FROM people") or die(mysql_error());
while($info = mysql_fetch_array( $data )){
<!--THIS CODE BELOW -->
echo "<img src=\"uploads/".$info['pic'] . "\" alt=\"<b><a href=\"display.php?id=".$info['id']."\">".$info['name']."</b><br />".$info['sex']. "<br />".$info['location'].
"<br />".$info['age']."</a>";
}
?>
</div>
<div id="name">
</div>
<!-- right nav bar -->
<div id="right">
<span class="prev">Prev</span>
<span class="next">Next</span>
<ul class="nav"></ul>
</div>
</div>
</body>
</html>
I would appreciate your help folks to be able to add link to the name dynamically.
instead of echo-ing the string, why not read it into a variable and echo the variable inside you html at the appropriate location <?php echo $myString; ?> also looks like you are using HTML inside the alt attribute. You can't do that. Even if you can do that, you are using double quotes inside double quotes, which will end the double quote and break the string.
Try changing your echo command to:
echo "<img src=\"uploads/".$info['pic'] . "\" alt=\"<b><a href='display.php?id=".$info['id']."'>".$info['name']."</b><br />".$info['sex']. "<br />".$info['location'].
"<br />".$info['age']."</a>";
The only thing Ive changed is the anchor link (i.e. the part below I replace " with '
<a href='display.php?id=".$info['id']."'>
I have a JQModal alert that needs to come up when a client's site is first accessed, but not show again when the index page is accessed again from inside the site. I'm not real far along in setting up session cookies so I'll be needing some explicit help, if that's possible. I've set up a short page with the vitals on it to test with: The URL is http://www.caycecookbook.com/pop_ups/jqm_onDocReady/code.php. I'm attaching the code here.
<?php session_start();
if( $_SESSION['visited'] ){
//don't show the modal box
} else {
$_SESSION['visited'] = true;
//show modal box;
}
?>
<!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>Cayce CookBook</title>
<!-- >>>>>>>>>> TOGGLE-INSERT DEPENDENCIES >>>>>>>>>> -->
<!-- >>>>>>>>>> TOGGLE-INSERT DEPENDENCIES >>>>>>>>>> -->
<link href="css/vwd_up.css" rel="stylesheet" type="text/css" />
<script src="scripts/main.js" type="text/javascript"></script>
<!-- <<<<<<<<<< TOGGLE-INSERT DEPENDENCIES <<<<<<<<<< -->
<!-- <<<<<<<<<< TOGGLE-INSERT DEPENDENCIES <<<<<<<<<< -->
<!-- >>>>>>>>>> jqMODAL DEPENDENCIES >>>>>>>>>> -->
<!-- >>>>>>>>>> jqMODAL DEPENDENCIES >>>>>>>>>> -->
<script type="text/javascript" src="scripts/jquery-1.5.1.js"></script>
<script type="text/javascript" src="scripts/jqModal.js"></script>
<style type="text/css">
/* Optional: image cacheing. Any images contained in this div will be
loaded offscreen, and thus cached. Caching CSS created with the help of;
Klaus Hartl <klaus.hartl#stilbuero.de> */
#media projection, screen {
div.imgCache { position: absolute; left: -8000px; top: -8000px; }
div.imgCache img { display:block; }
}
#media print { div.imgCache { display: none; } }
</style>
<style type="text/css">
/* jqModal base Styling courtesy of;
Brice Burgess <bhb#iceburg.net> */
/* The Window's CSS z-index value is respected (takes priority). If none is supplied,
the Window's z-index value will be set to 3000 by default (in jqModal.js). You
can change this value by either;
a) supplying one via CSS
b) passing the "zIndex" parameter. E.g. (window).jqm({zIndex: 500}); */
.jqmWindow {
display: none;
position: fixed;
top: 5%;
left: 50%;
margin-left: -265px;
width: 530px;
/*width: auto;*/
background-color:#777777;
color: #333;
border: 1px solid black;
padding: 0px;
}
.jqmOverlay { background-color: #000; }
/* Fixed posistioning emulation for IE6
Star selector used to hide definition from browsers other than IE6
For valid CSS, use a conditional include instead */
* html .jqmWindow {
position: absolute;
top: expression((document.documentElement.scrollTop || document.body.scrollTop) + Math.round(17 * (document.documentElement.offsetHeight || document.body.clientHeight) / 100) + 'px');
}
</style>
<!-- <<<<<<<<<< jqMODAL DEPENDENCIES <<<<<<<<<< -->
<!-- <<<<<<<<<< jqMODAL DEPENDENCIES <<<<<<<<<< -->
</head>
<body>
<script type="text/javascript">
$(document).ready(function() {
$('#rename').jqm();
$('#rename').jqmShow(); // This is the line you need to add.
});
</script>
<!-- POP-UP DIV -->
<DIV class="jqmWindow" id="rename" style="padding:18px 0px 12px 0px;">
<TABLE align="center" width="530" border="0" cellspacing="0" cellpadding="0" bgcolor="#7777777">
<TR><TD align="center"><P style="margin: 12px 12px 12px 12px;"><img src="images/hey_there.jpg" width="504" height="360" border="0"></p></td></tr>
<TR><TD align="center" valign="middle"><P style="margin:6px 0px 0px 0px;">Close</p></td></tr>
</table>
</div>
</body>
</html>
You can't control js/html/css behavior explicitly from PHP.
You have two options
1) Don't include the javascript for modal box if $_SESSION['visited'] is true
2) Echo true/false from $_SESSION['visited'] to javascript code and do a logic there
Code for first option:
<?php session_start(); ?>
<!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>Cayce CookBook</title>
<?php
if( $_SESSION['visited'] ){
} else {
$_SESSION['visited'] = true;
?>
<!-- >>>>>>>>>> jqMODAL DEPENDENCIES >>>>>>>>>> -->
<!-- >>>>>>>>>> jqMODAL DEPENDENCIES >>>>>>>>>> -->
<script type="text/javascript" src="scripts/jquery-1.5.1.js"></script>
<script type="text/javascript" src="scripts/jqModal.js"></script>
<style type="text/css">
/* Optional: image cacheing. Any images contained in this div will be
loaded offscreen, and thus cached. Caching CSS created with the help of;
Klaus Hartl <klaus.hartl#stilbuero.de> */
#media projection, screen {
div.imgCache { position: absolute; left: -8000px; top: -8000px; }
div.imgCache img { display:block; }
}
#media print { div.imgCache { display: none; } }
</style>
<style type="text/css">
/* jqModal base Styling courtesy of;
Brice Burgess <bhb#iceburg.net> */
/* The Window's CSS z-index value is respected (takes priority). If none is supplied,
the Window's z-index value will be set to 3000 by default (in jqModal.js). You
can change this value by either;
a) supplying one via CSS
b) passing the "zIndex" parameter. E.g. (window).jqm({zIndex: 500}); */
.jqmWindow {
display: none;
position: fixed;
top: 5%;
left: 50%;
margin-left: -265px;
width: 530px;
/*width: auto;*/
background-color:#777777;
color: #333;
border: 1px solid black;
padding: 0px;
}
.jqmOverlay { background-color: #000; }
/* Fixed posistioning emulation for IE6
Star selector used to hide definition from browsers other than IE6
For valid CSS, use a conditional include instead */
* html .jqmWindow {
position: absolute;
top: expression((document.documentElement.scrollTop || document.body.scrollTop) + Math.round(17 * (document.documentElement.offsetHeight || document.body.clientHeight) / 100) + 'px');
}
</style>
<!-- <<<<<<<<<< jqMODAL DEPENDENCIES <<<<<<<<<< -->
<!-- <<<<<<<<<< jqMODAL DEPENDENCIES <<<<<<<<<< -->
<?php
}
?>
<!-- >>>>>>>>>> TOGGLE-INSERT DEPENDENCIES >>>>>>>>>> -->
<!-- >>>>>>>>>> TOGGLE-INSERT DEPENDENCIES >>>>>>>>>> -->
<link href="css/vwd_up.css" rel="stylesheet" type="text/css" />
<script src="scripts/main.js" type="text/javascript"></script>
<!-- <<<<<<<<<< TOGGLE-INSERT DEPENDENCIES <<<<<<<<<< -->
<!-- <<<<<<<<<< TOGGLE-INSERT DEPENDENCIES <<<<<<<<<< -->
</head>
<body>
<script type="text/javascript">
$(document).ready(function() {
$('#rename').jqm();
$('#rename').jqmShow(); // This is the line you need to add.
});
</script>
<!-- POP-UP DIV -->
<DIV class="jqmWindow" id="rename" style="padding:18px 0px 12px 0px;">
<TABLE align="center" width="530" border="0" cellspacing="0" cellpadding="0" bgcolor="#7777777">
<TR><TD align="center"><P style="margin: 12px 12px 12px 12px;"><img src="images/hey_there.jpg" width="504" height="360" border="0"></p></td></tr>
<TR><TD align="center" valign="middle"><P style="margin:6px 0px 0px 0px;">Close</p></td></tr>
</table>
</div>
</body>
</html>
Replace below code in your file in below code i changed 3 things.
1> position of php code. I put php code at the end of file
2> Cookie rather than session
3> javascript popup opning code has some changes
Please apply below file after still you have some problem than let me know your prob.
<!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>Cayce CookBook</title>
<!-- >>>>>>>>>> TOGGLE-INSERT DEPENDENCIES >>>>>>>>>> -->
<!-- >>>>>>>>>> TOGGLE-INSERT DEPENDENCIES >>>>>>>>>> -->
<link href="css/vwd_up.css" rel="stylesheet" type="text/css" />
<script src="scripts/main.js" type="text/javascript"></script>
<!-- <<<<<<<<<< TOGGLE-INSERT DEPENDENCIES <<<<<<<<<< -->
<!-- <<<<<<<<<< TOGGLE-INSERT DEPENDENCIES <<<<<<<<<< -->
<!-- >>>>>>>>>> jqMODAL DEPENDENCIES >>>>>>>>>> -->
<!-- >>>>>>>>>> jqMODAL DEPENDENCIES >>>>>>>>>> -->
<script type="text/javascript" src="scripts/jquery-1.5.1.js"></script>
<script type="text/javascript" src="scripts/jqModal.js"></script>
<style type="text/css">
/* Optional: image cacheing. Any images contained in this div will be
loaded offscreen, and thus cached. Caching CSS created with the help of;
Klaus Hartl <klaus.hartl#stilbuero.de> */
#media projection, screen {
div.imgCache { position: absolute; left: -8000px; top: -8000px; }
div.imgCache img { display:block; }
}
#media print { div.imgCache { display: none; } }
</style>
<style type="text/css">
/* jqModal base Styling courtesy of;
Brice Burgess <bhb#iceburg.net> */
/* The Window's CSS z-index value is respected (takes priority). If none is supplied,
the Window's z-index value will be set to 3000 by default (in jqModal.js). You
can change this value by either;
a) supplying one via CSS
b) passing the "zIndex" parameter. E.g. (window).jqm({zIndex: 500}); */
.jqmWindow {
display: none;
position: fixed;
top: 5%;
left: 50%;
margin-left: -265px;
width: 530px;
/*width: auto;*/
background-color:#777777;
color: #333;
border: 1px solid black;
padding: 0px;
}
.jqmOverlay { background-color: #000; }
/* Fixed posistioning emulation for IE6
Star selector used to hide definition from browsers other than IE6
For valid CSS, use a conditional include instead */
* html .jqmWindow {
position: absolute;
top: expression((document.documentElement.scrollTop || document.body.scrollTop) + Math.round(17 * (document.documentElement.offsetHeight || document.body.clientHeight) / 100) + 'px');
}
</style>
<!-- <<<<<<<<<< jqMODAL DEPENDENCIES <<<<<<<<<< -->
<!-- <<<<<<<<<< jqMODAL DEPENDENCIES <<<<<<<<<< -->
</head>
<body>
<script type="text/javascript">
<?php if( !isset($_COOKIE["visited"]) || $_COOKIE["visited"] != true ): ?>
$('#rename').jqm();
$('#rename').jqmShow(); // This is the line you need to add.
<?php endif; ?>
</script>
<!-- POP-UP DIV -->
<DIV class="jqmWindow" id="rename" style="padding:18px 0px 12px 0px;">
<TABLE align="center" width="530" border="0" cellspacing="0" cellpadding="0" bgcolor="#7777777">
<TR><TD align="center"><P style="margin: 12px 12px 12px 12px;"><img src="images/hey_there.jpg" width="504" height="360" border="0"></p></td></tr>
<TR><TD align="center" valign="middle"><P style="margin:6px 0px 0px 0px;">Close</p></td></tr>
</table>
</div>
<?php
if( !isset($_COOKIE["visited"]) || $_COOKIE["visited"] != true )
{
$expireTime = time() + (60 * 60 * 24 * 1);
// Set cookie for 1 day or 24 hour from current time
setcookie("visited", true, );
}
?>
</body>
</html>