/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Why i’m getting error GET ? And also some errors with yellow warning ?

My php file should get images from a directory on my ftp server and display them in slideshow.

This is the page:

[URL=”http://newsxpressmedia.com/slideshow.php”]http://newsxpressmedia.com/slideshow.php[/URL]

And this is the slideshow.php code:

[CODE]<!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”
lang=”en”
xml:lang=”en”
><head>

<meta
http-equiv=”Content-Type”
content=”text/html; charset=utf-8″
/>

<meta
http-equiv=”Content-Language”
content=”en”
/>

<meta
name=”viewport”
content=”width=device-width; height=device-height; initial-scale=1.0″
/>

<link
type=”text/css”
rel=”stylesheet”
href=”screen.css”
media=”screen,projection,tv”
/>

<title>
change picture
</title>

</head><body>

<div id=”slideCounter”></div>
<div id=”slideShow”>
<?php

//$allowed_types=”(.jpg$)|(.png$)|(.jpeg$)|(.gif$) |(.Gif$)”;
$allowed_types = array(‘png’,’jpg’,’jpeg’,’gif’);
$imageDir = ‘files/radar-simulation-files’;
/*
Assumes this .php is being run from the http root on the same
domain as the desired image files.
*/

$handle = opendir($imageDir);
while (($imgPath = readdir($handle)) !== false) if (
in_array(
strtolower(pathinfo($imgPath, PATHINFO_EXTENSION)),
$allowed_types
)) echo ‘
<img src=”‘, $imageDir, ‘/’, $imgPath, ‘” alt=”slide” />’;
closedir($handle);

?>
<!– #slideShow –></div>

<script type=”text/javascript”>(function(d) {

// user defines

var
swapHours = 0,
swapMinutes = 0,
swapSeconds = 5,
swapTotal = (swapHours * 60 + swapMinutes) * 60 + swapSeconds,
loopSlideShow = true;
var w = window;

// some handy helper functions

function classExists(e, className) {
return RegExp(‘(\s|^)’ + className + ‘(\s|$)’).test(e.className);
}

function classAdd(e, className) {
if (classExists(e, className))
e.className += (e.className ? ‘ ‘ : ”) + className;
return true;
}

function classRemove(e, className) {
if (!classExists(e, className)) return false;
e.className = e.className.replace(
new RegExp(‘(\s|^)’ + n + ‘(\s|$)’), ‘ ‘
) . replace(/^s+|s+$/g,”);
return true;
}

function textReplace(e, newtext) {
if (d.innerText) e.innerText = newText;
else e.textContent = newText;
}

function nodeFirst(e) {
e = e.firstChild;
while (e && e.nodeType != 1) e = e.nextSibling;
return e;
}

function nodeLast(e) {
e = e.lastChild;
while (e && e.nodeType != 1) e = e.prevSibling;
return e;
}

function nodeNext(e) {
while (e) if ((e = e.nextSibling).nodeType == 1) return e;
return null;
}

function nodePrev(e) {
while (e) if ((e = e.prevSibling).nodeType == 1) return e;
return null;
}

// slideShow setup

var
slideShow = d.getElementById(‘slideShow’),
slideCounter = d.getElementById(‘slideCounter’),
firstSlide = nodeFirst(slideShow),
lastSlide = nodeLast(slideShow),
currentSlide = firstSlide,
swapCounter;

classAdd(slideShow, ‘ss_scripted’);
classAdd(currentSlide, ‘ss_show’);

// slideShow functions

function showCounter() {
textReplace(slideCounter,
Math.floor(swapCounter / 3600) + ‘:’ +
(Math.floor(swapCounter / 60) % 60) + ‘:’ +
swapCounter % 60
);
}

function resetCounter() {
swapCounter = swapTotal;
showCounter();
}

function makeSlide(newSlide) {
classRemove(currentSlide, ‘ss_show’);
currentSlide = newSlide;
classAdd(currentSlide, ‘ss_show’);
}

function nextSlide() {
resetCounter();
var newSlide = nodeNext(currentSlide);
if (newSlide) makeSlide(newSlide);
else if (loopSlideShow) makeSlide(firstSlide);
}

function prevSlide() {
resetCounter();
var newSlide = nodePrev(currentSlide);
if (newSlide) makeSlide(newSlide);
else if (loopSlideShow) makeSlide(lastSlide);
}

function slideUpdate() {
if (swapCounter–) showCounter(); else nextSlide();
}

function startSlideShow() {
resetCounter();
setInterval(slideUpdate, 1000);
}

// wait for onload to actually start the countdown

if (window.eventListener) w.addEventListener(‘load’, startSlideShow, false);
else w.addEventListener(‘onload’, startSlideShow);

})(document);</script>

<style>
.ss_scripted img { display:none; }
.ss_scripted .ss_show { display:block; }
</style>
</body></html>[/CODE]

This is the slideshow.js code:

[CODE](function(d, w) {

// user defines

var
swapHours = 0,
swapMinutes = 0,
swapSeconds = 5,
swapTotal = (swapHours * 60 + swapMinutes) * 60 + swapSeconds,
loopSlideShow = true;

// some handy helper functions

function classExists(e, className) {
return RegExp(‘(\s|^)’ + className + ‘(\s|$)’).test(e.className);
}

function classAdd(e, className) {
if (classExists(e, className)) return false;
e.className += (e.className ? ‘ ‘ : ”) + className;
return true;
}

function classRemove(e, className) {
if (!classExists(e, className)) return false;
e.className = e.className.replace(
new RegExp(‘(\s|^)’ + className + ‘(\s|$)’), ‘ ‘
) . replace(/^s+|s+$/g,”);
return true;
}

function nodeFirst(e) {
e = e.firstChild;
while (e && e.nodeType != 1) e = e.nextSibling;
return e;
}

function nodeLast(e) {
e = e.lastChild;
while (e && e.nodeType != 1) e = e.previousSibling;
return e;
}

function nodeNext(e) {
while (e = e.nextSibling) if (e.nodeType == 1) return e;
return null;
}

function nodePrev(e) {
while (e = e.previousSibling) if (e.nodeType == 1) return e;
return null;
}

function nodeFlush(e) {
while (e.firstChild) e.removeChild(e.firstChild);
}

function nodeReplace(e, newNode) {
nodeFlush(e);
e.appendChild(
typeof newNode == ‘object’ ? newNode : d.createTextNode(newNode)
);
}

function make(tagName, child, attribs, parent) {
var e = d.createElement(tagName);
if (child) e.appendChild(
typeof child == ‘object’ ? child : d.createTextNode(child)
);
if (attribs) for (var i in attribs) e[i] = attribs[i];
if (parent) parent.appendChild(e);
return e;
}

function prevent(e, deselect) {
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
if (e.preventDefault) e.preventDefault();
e.returnValue = false;
if (deselect) {
if (w.getSelection) w.getSelection().removeAllRanges();
if (d.selection) d.selection.empty();
}
}

function controlEvent(e, handler) {
handler();
e = e || window.event;
prevent(e, true);
}

function clockFormat(value) {
value = String(Math.floor(value));
while (value.length < 2) value = ‘0’ + value;
return value;
}

// slideShow functions

function showCounter() {
nodeReplace(slideCounter,
clockFormat(swapCounter / 3600) + ‘:’ +
clockFormat((swapCounter / 60) % 60) + ‘:’ +
clockFormat(swapCounter % 60)
);
}

function resetCounter() {
swapCounter = swapTotal;
showCounter();
}

function makeSlide(newSlide) {
classRemove(currentSlide, ‘ss_show’);
currentSlide = newSlide;
classAdd(currentSlide, ‘ss_show’);
}

function nextSlide() {
resetCounter();
var newSlide = nodeNext(currentSlide);
if (newSlide) makeSlide(newSlide);
else if (loopSlideShow) makeSlide(firstSlide);
}

function prevSlide() {
resetCounter();
var newSlide = nodePrev(currentSlide);
if (newSlide) makeSlide(newSlide);
else if (loopSlideShow) makeSlide(lastSlide);
}

function slideUpdate() {
if (swapCounter–) showCounter(); else nextSlide();
}

function startSlideShow() {
resetCounter();
setInterval(slideUpdate, 1000);
}

// slideShow setup

var
slideShow = d.getElementById(‘slideShow’),
slideCounter = make(‘div’, false, { id : ‘slideCounter’ }),
slideControls = make(‘div’, false, { id : ‘slideControls’ }),
slidePrev = make(‘a’, ‘Previous Slide’, {
onclick : function(e) { controlEvent(e, prevSlide); },
className : ‘previous’,
href : ‘#’
}, slideControls),
slideNext = make(‘a’, ‘Next Slide’, {
onclick : function(e) { controlEvent(e, nextSlide); },
className : ‘next’,
href : ‘#’
}, slideControls),
firstSlide = nodeFirst(slideShow),
lastSlide = nodeLast(slideShow),
currentSlide = firstSlide,
swapCounter;

slideShow.parentNode.insertBefore(slideCounter, slideShow);
slideShow.parentNode.insertBefore(slideControls, slideShow.nextSibling);

classAdd(slideShow, ‘ss_scripted’);
classAdd(currentSlide, ‘ss_show’);

// wait for onload to actually start the countdown

if (w.addEventListener) w.addEventListener(‘load’, startSlideShow, false);
else w.attachEvent(‘onload’, startSlideShow);

})(document, window);[/CODE]

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@ChocoladeauthorJan 06.2015 — The problem is that i see still images and not slideshow.

When i'm doing right click inspect element i see this errors:

slideshow.php:22 The value "device-width;" for key "width" is invalid, and has been ignored.

slideshow.php:22 The value "device-height;" for key "height" is invalid, and has been ignored.

slideshow.php:22 Error parsing a meta element's content: ';' is not a valid key-value pair separator. Please use ',' instead.

slideshow.php:29 GET http://newsxpressmedia.com/screen.css

How can i resolve/fix the errors ?

Whne i'm going to the slideshow.php i should see slideshow with buttons.






And last screen.css

[CODE]/* null margins and padding to give good cross-browser baseline */
html,body,address,blockquote,div,
form,fieldset,caption,
h1,h2,h3,h4,h5,h6,
hr,ul,li,ol,ul,dd,dt,dl,
table,tr,td,th,p,img {
margin:0;
padding:0;
}

img,fieldset {
border:none;
}

hr {
display:none;
/*
HR in my code are for semantic breaks in topic/section, NOT
style/presenation, so hide them from screen.css users
*/
}

@media (max-width:600px) {
* {
-webkit-text-size-adjust:none;
-moz-text-size-adjust:none;
-ms-text-size-adjust:none;
}
}

body {
font:normal 85%/150% "segoe ui",helvetica,sans-serif;
}

.ss_scripted img {
display:none;
}

.ss_scripted .ss_show {
display:block;
}

#slideShow img {
margin:0 auto;
}

#slideCounter {
text-align:center;
padding:0.25em 1em;
font:bold 200%/120% consolas,courier,monospace;
color:#C00;
}

#slideControls {
width:512px;
padding:0.5em 0;
margin:0 auto;
}

#slideControls a {
float:left;
padding:0.25em 0.6em;
text-decoration:none;
color:#000;
background:#EEE;
border:2px solid #666;
-webkit-border-radius:1em;
-moz-border-radius:1em;
border-radius:1em;
-webkit-box-shadow:
inset 0 -0.5em 1em rgba(0,0,0,0.3),
0 0 1px #000;
-moz-box-shadow:
inset 0 -0.5em 1em rgba(0,0,0,0.3),
0 0 1px #000;
box-shadow:
inset 0 -0.5em 1em rgba(0,0,0,0.3),
0 0 1px #000;
}

#slideControls a:active,
#slideControls a:focus,
#slideControls a:hover {
background:#FFF;
}

#slideControls .next {
float:right;
}[/CODE]
Copy linkTweet thisAlerts:
@ChocoladeauthorJan 06.2015 — What i'm trying to do is to add all the images in my ftp server from a directory on my ftp server to array and display the images in the slideshow.

It did work when i the slideshow.php was with manual images links inside.

But i wanted to add the buttons timer and the array instead add manual link for each image.

This is the old php code where it was with manual images and in this i didn't have errors.

The errors came up when i changed the php code. http://www.cutcodedown.com/for_others/chocolade/slideshow.php

Now after changed the php file code im getting the errors.
Copy linkTweet thisAlerts:
@ChocoladeauthorJan 06.2015 — First after uploaded the screen.css file to my ftp server i still see the images still not in slideshow:

http://newsxpressmedia.com/slideshow.php

And when doing right click inspect element i see:

slideshow.php:22 The value "device-width;" for key "width" is invalid, and has been ignored.

slideshow.php:22 The value "device-height;" for key "height" is invalid, and has been ignored.

slideshow.php:22 Error parsing a meta element's content: ';' is not a valid key-value pair separator. Please use ',' instead.


Line 22 in slideshow.php is empty.

I'm not sure if this errors/warnings are the problem why i don't see the slideshow.

I have no other errors in red.
Copy linkTweet thisAlerts:
@Kevin2Jan 06.2015 — slideshow.php:22 Error parsing a meta element's content: ';' is not a valid key-value pair separator. Please use ',' instead.[/QUOTE]

Replace:
&lt;meta
name="viewport"
content="width=device-width[COLOR="#FF0000"][B];[/B][/COLOR] height=device-height[COLOR="#FF0000"][B];[/B][/COLOR] initial-scale=1.0"
/&gt;


With:
&lt;meta
name="viewport"
content="width=device-width[COLOR="#FF0000"][B],[/B][/COLOR] height=device-height[COLOR="#FF0000"][B],[/B][/COLOR] initial-scale=1.0"
/&gt;
×

Success!

Help @Chocolade spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...