Jump to content

Need new set of eyes, script doesn't display in page


SmokingMan
 Share

Recommended Posts

Okay, I have a page that's supposed to display a random quote when the page loads. I have the quotes set up in a php array and I use "require" to call this script when the page loads. I have looked at the script and the call for so long my eyes hurt and I can't seem to figure out why it's not loading. I don't have the page published yet but here are all of the files for you to look at. It's probably something very simple but I can't see it.HTML:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>	<!-- Last Updated On Saturday, May 08, 2010 --><meta name="keywords" content="Fort Wayne,Indiana,Summit City,Three Rivers,The Pointe,NE Indiana" /><meta http-equiv="Content-Type" content="text/html; charset=windows-1252" /><meta content= "Mike Saylor" name= "author" /><!-- Linked Stylesheet Libraries--><link href="stylesheets/FtwinStylesheet.css" rel="stylesheet" type="text/css" /><title>Welcome To FTWIN.com</title></head><body><div class="container"> <div class="body">	<div class="lcolumn">	<a href="http://www.ftwin.com" title="www.ftwin.com"><img alt="ftwin2 (10K)" 		src="images/logos/ftwin2.png" class="noborder" height="125" width="250" />	</a>	<img alt="dogrun (12K)" src="images/dogrun.gif" height="35" width="200" />	<a href="http://thepointechurch.net/messages"><img alt="The Pointe Logo (13.56K)" 		src="http://thepointechurch.net/assets/1103/4-5-9REF.JPG" class="noborder" 		height="187" title="The Pointe Church Podcasts" width="200" />	</a>		<div class="quotes">			<?php require("scripts/random-quote.php"); ?>		</div>	</div>	<div class="rcolumn">		<div class="rbanner">		<a href="http://www.icdsoft.com" title="Web Hosting By ICDSoft.com" 			onclick="java script:document.location='http://www.icdsoft.com?aff=mgsaylor.FtwinMain';return false;">			<img width="728" height="90" border="0" 			src="http://reseller.icdsoft.com/b/mgsaylor.FtwinMain/icdsoft-4_728x90.gif" 			alt="Web Hosting By ICDSoft.com"/>		</a>		</div>		<div class="rcontent">		<p><img alt="FortWayneSkyline (15K)" src="images/FortWayneSkyline.jpg" 			class="fwskyline" height="133" title="Fort Wayne Skyline" width="225" />			blah blah blah blah blah blah blah blah blah blah blah blah 			blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah 			blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah			and finally blah 		</p>		</div>	</div></div>	<div class="footer">footer ads and stuff</div>	<div class="bottom"><!-- --></div></div></body></html>

CSS:

/* FTWIN.com Stylesheet - Last updated Saturday, May 08, 2010 */.container {	width:100%;	background:#f0ffff;}.rbanner {	width:100%;	height:125px;	text-align:center;}.body {	width:95%; 	margin-left:2.5%;	text-align:center;}.lcolumn { 	float:left;	padding-top:20px;	width:23%;	text-align:center;}.quotes {	padding-top:20px;	padding-left:15px;	padding-bottom:20px;	padding-right:15px;	font-family:'Comic Sans MS','Monotype Corsiva',cursive;	font-weight:500; 	font-style:italic; 	color:#8b0000; 	text-align:justify;}.rcolumn { 	float:right;	padding-top:20px;	width:76%;	text-align:center;}.rcontent {	padding-top:21px;	padding-left:2.5%;	padding-right:2.5%;	text-align:justify;}.fwskyline {	float:right;	padding-left:10px;	padding-right:10px;	padding-bottom:10px;}.footer { 	clear:both;	padding-top:20px; 	width:95%;	margin-left:2.5%;	text-align:center;}.bottom { 	clear:both;}.noborder { 	border:0;}

PHP Script:

	  <?php 	  //Randomizes quotes to be displayed on web page, all quotes are stored in the array 	  //"$quotes".  As the page loads the first quote in the array is displayed.  Since the array 	  //has been randomized at load, the quote displayed will change each time.  This script	  //containing *62* quotes was last updated on 05/08/2010. 	  $quotes = array (		  ""Always vote for principal, though you may vote alone, and you may cherish the sweetest reflection that your vote is never lost."<br /><br />~ John Quincy Adams ~",				""The darkest places in ###### are reserved for those who maintain their neutrality in times of moral crisis."<br /><br />~ Dante Alighieri ~",				""640K ought to be enough for anybody."<br /><br />~ Bill Gates ~",				""Life improves slowly and goes wrong fast, and only catastrophe is clearly visible."<br /><br />~ Edward Teller ~",				""Abortion is advocated only by persons who have themselves been born."<br /><br />~ Ronald Reagan ~",				""The universe is not required to be in perfect harmony with human ambition."<br /><br />~ Carl Sagan ~",				""This country, with it's institutions, belongs to the people who inhabit it.  Whenever they shall grow weary of the existing government, they can excercise their constitutional right of ammending it, or excercise their revolutionary right to overthrow it."<br /><br />~ Abraham Lincoln ~",				""A nickel ain't worth a dime anymore."<br /><br />~ Yogi Berra ~",				""Always go to other people's funerals, otherwise they won't come to yours."<br /><br />~ Yogi Berra ~",				""Begin doing what you want to do now.  We are not living in eternity.  We have only this moment, sparkling like a star in our hand - and melting like a snowflake."<br /><br />~ Sir Francis Bacon ~",				""It is not easy to see how the more extreme forms of nationalism can long survive when men have seen the Earth in it's true perspective as a single small globe against the stars."<br /><br />~ Arthur C. Clarke ~",				""Each man must for himself alone decide what is right and what is wrong, which course is patriotic and which isn't.   You cannot shirk this and be a man.   To decide against your conviction is to be an unqualified and excusable traitor, both to yourself and to your country, let me label you as they may."<br /><br />~ Mark Twain ~",				""They have computers, and they may have other weapons of mass destruction."<br /><br />~ Janet Reno ~",				""A diplomat is a man who always remembers a woman's birthday but never remembers her age."<br /><br />~ Robert Frost ~",				""By three methods we may learn wisdom: First, by reflection, which is noblest; Second, by imitation, which is easiest; and third by experience, which is the bitterest."<br /><br />~ Confucious ~",				""A democracy is nothing more than mob rule, where fifty-one percent of the people may take away the rights of the other forty-nine."<br /><br />~ Thomas Jefferson ~",				""Government is not reason, it is not eloquence, it is force; like fire, a troublesome servent and a fearful master.  Never for a moment should it be left to irresponsible action."<br /><br />~ George Washington ~",				""Democracy is the most vile form of government...  democracies have ever been spectacles of turbulence and contention: have ever been found incompatible with personal security or the rights of property: and have in general been as short in their lives as they have been violent in their deaths."<br /><br />~ James Madison ~", 				""The Constitution only guarantees the American people the right to pursue happiness.  You have to catch it yourself."<br /><br />~ Benjamin Franklin ~",				""Beware the leader who bangs the drum of war in order to whip the citizenry into a patriotic fervor.  For patriotism is indeed a double-edged sword.  It both emboldens the blood, just as it narrows the mind.  And when the drums of war have reached a fever pitch and the blood boils with hate and the mind has closed, the leader will have no need in siezing the rights of the citizenry.  Rather, the citizenry, infused with fear and patriotism, will offer up all of their rights to the leader and gladly so.  How do I know?  For this is what I have done.  And I am Julius Caesar."<br /><br />~ Julius Caesar ~",				""A man's only as old as the woman he feels."<br /><br />~ Groucho Marx ~",				""Politics have no relation to morals."<br /><br />~ Niccolo Machiavelli ~",				""Build me a son, O Lord, who will be strong enough to know when he is weak, and brave enough to face himself when he is afraid, one who will be proud and unbending in honest defeat, and humble and gentle in victory."<br /><br />~ General Douglas MacArthur ~",				""A well regulated militia, composed of the body of the people, trained in arms, is the best most natural defense of a free country."<br /><br />~ James Madison ~",				""There is no better than adversity.  Every defeat, every heartbreak, every loss contains it's own seed, it's own lesson on how to improve your performance the next time."<br /><br />~ Malcom X ~",				""You can lead a man to Congress, but you can't make him think."<br /><br />~ Milton Berle ~",				""There is no meeting of minds, no point of understanding with such terror.  Just a choice: Defeat it or be defeated by it.  And defeat it we must."<br /><br />	 Tony Blair ~",				""God created man, but I could do better."<br /><br />~ Erma Bombeck ~",				""In politics stupidity is not a handicap."<br /><br />~ Napoleon Boneparte ~",				""Look to the future, because that's where you'll spend the rest of your life."<br /><br />~ George Burns ~",				""Old age isn't so bad when you consider the alternatives."<br /><br />~ Cato ~",				""Victory at all costs, victory in spite of all terror, victory however long and hard the road may be; for without victory, there is no survival."<br /><br />~ Sir Winston Churchill ~",				""The two most common elements in the universe are hydrogen and stupidity."<br /><br />~ Harlan Ellison ~",				""We hang the petty thieves and appoint the great ones to public office."<br /><br />~ Aesop ~",				""We make war that we may live in peace."<br /><br />~ Aristotle ~",				""If at first you don't succeed, try, try again.  Then quit.  There's no point in being a damn fool about it."<br /><br />~ W. C. Fields ~",				""Any society that would give up a little liberty to gain a little security will deserve neither and lose both."<br /><br />~ Benjamin Franklin ~",				""The price good men pay for indifference to public affairs is to be ruled by evil men."<br /><br />~ Plato ~",				""No bastard ever won a war by dying for his country.  He won it by making the other poor dumb bastard die for his country."<br /><br />~ General George S. Patton ~",				""Arms discourage and keep the invader and plunderer in awe, and preserve order in the world as well as property...Horrid mischief would ensue were [the law-abiding] deprived of the use of them."<br /><br />~ Thomas Paine ~",				""It is far better to grasp the universe as it really is than to persist in delusion, however satisfying and reassuring."<br /><br />~ Carl Sagan ~",				""Strength does not come from winning.  Your struggles develop your strengths.  When you go through hardships and decide not to surrender, that is strength."<br /><br />~ Arnold Schwarzenegger ~",				""Courage is being scared to death...and saddling up anyway."<br /><br />~ John Wayne ~",				""America stands for liberty, for the pursuit of happiness and for the unalienable right for life.  The right for life cannot be granted or denied by government because it does not come from government, it comes from the creator of life."<br /><br />~ George W. Bush ~",				""America will never seek a permission slip to defend the security of our people."<br /><br />~ George W. Bush ~",				""Everywhere that freedom stirs, let tyrants fear."<br /><br />~ George W. Bush ~",				""Some folks look at me and see a certain swagger, which in Texas is called "Walking."<br /><br />~ George W. Bush ~",				""States should have the right to enact...laws...particularly to end the inhumane practice of ending a life that otherwise could live."<br /><br />~ George W. Bush ~",				""The course of this conflict is not known, yet it's outcome is certain.  Freedom and fear, justice and cruelty have always been at war, and we know that God is not nuetral between them."<br /><br />~ George W. Bush ~",				""When I take action, I'm not going to fire a $2 million missle at a $10 empty tent and hit a camel in the butt.  It's going to be decisive."<br /><br />~ George W, Bush ~",				""I'm an internationalist.  I'd like to see our troops dispersed through the world only at the directive of the United Nations."<br /><br />~ John F. Kerry ~",				""When we, through our educational culture, through the media, through the entertainment culture, give our children the impression that human beings cannot control their passions, we are telling them, in effect, that human beings cannot be trusted with freedom."<br /><br />~ Alan Keyes ~",				""When I was born I was so surprised I didn't talk for a year and a half."<br /><br />~ Gracie Allen ~",				""Be not afraid."<br /><br />~ Pope John Paul II ~",				""No...No, you can't get away...From ######'s heart I stab at thee...For hates sake I spit my last breath at thee."<br /><br />~ Khan Noonien Singh ~",				""They're all helpable if they wake up this side of the dirt."<br /><br />~ Dog the Bounty Hunter ~",		  ""An adult faith does not follow the waves of fashion and the latest novelties."<br /><br />~ Pope Benedict XVI ~",		  ""Having a clear faith, based on the creed of the church, is often labeled today as fundamentalism, whereas relativism, which is letting oneself be tossed and swept along by every wind of teaching, looks like the only attitude acceptable to today's standards."<br /><br />~ Pope Benedict XVI ~",		  ""What is a moderate interpretation of the test? Halfway between what it really means and what you'd like it to mean?."<br /><br />~ Antonin Scalia ~",		  ""Hang 'em first, try 'em later."<br /><br />~ Judge Roy Bean ~",				""In Washington, only two kinds of religion are tolerated: vague beliefs strongly affirmed and stong beliefs vaguely expressed."<br /><br />~ Eugene McCarthy ~",				""If I have distressing apprehensions..I am supported..by a confidence, that the most gracious Being, who has hitherto watched over the interests and averted the perils of the United States, will never suffer so fair an inheritance speak to become a prey to anarchy, despotism, or any other species of oppression.$#34;<br />< br />~ George Washington, 1789 ~"	  );  	  //randomizes the quote array	  shuffle($quotes);  	  	  //displays the first quote in the array that has been randomized and 	  //places divider between this quote and the next	  echo($quotes[0]."<br />");   												  ?>

I would have attached the files to make it a little easier to read, but I couldn't find a way to do it...sorry. :)

Link to comment
Share on other sites

I think it is the way the text is added to the array two double quotes, at start, and it does not seem to finish at end correctly.try starting, finishing with single quote, you will also have to escape any apostrophes in the text also example below:'"Always go to other people\'s funerals, otherwise they won\'t come to yours."<br /><br />~ Yogi Berra ~',try a couple first, with and without apostrophes within text as a test, before doing them all.

Edited by dsonesuk
Link to comment
Share on other sites

I used find, and replace first all apostrophes ' to \' : "" to '" : and ", to ', and it works now

	  $quotes = array (		  '"Always vote for principal, though you may vote alone, and you may cherish the sweetest reflection that your vote is never lost."<br /><br />~ John Quincy Adams ~',				'"The darkest places in ###### are reserved for those who maintain their neutrality in times of moral crisis."<br /><br />~ Dante Alighieri ~',				'"640K ought to be enough for anybody."<br /><br />~ Bill Gates ~',				'"Life improves slowly and goes wrong fast, and only catastrophe is clearly visible."<br /><br />~ Edward Teller ~',				'"Abortion is advocated only by persons who have themselves been born."<br /><br />~ Ronald Reagan ~',				'"The universe is not required to be in perfect harmony with human ambition."<br /><br />~ Carl Sagan ~',				'"This country, with it\'s institutions, belongs to the people who inhabit it.  Whenever they shall grow weary of the existing government, they can excercise their constitutional right of ammending it, or excercise their revolutionary right to overthrow it."<br /><br />~ Abraham Lincoln ~',				'"A nickel ain\'t worth a dime anymore."<br /><br />~ Yogi Berra ~',				'"Always go to other people\'s funerals, otherwise they won\'t come to yours."<br /><br />~ Yogi Berra ~',				'"Begin doing what you want to do now.  We are not living in eternity.  We have only this moment, sparkling like a star in our hand - and melting like a snowflake."<br /><br />~ Sir Francis Bacon ~',				'"It is not easy to see how the more extreme forms of nationalism can long survive when men have seen the Earth in it\'s true perspective as a single small globe against the stars."<br /><br />~ Arthur C. Clarke ~',				'"Each man must for himself alone decide what is right and what is wrong, which course is patriotic and which isn\'t.   You cannot shirk this and be a man.   To decide against your conviction is to be an unqualified and excusable traitor, both to yourself and to your country, let me label you as they may."<br /><br />~ Mark Twain ~',				'"They have computers, and they may have other weapons of mass destruction."<br /><br />~ Janet Reno ~',				'"A diplomat is a man who always remembers a woman\'s birthday but never remembers her age."<br /><br />~ Robert Frost ~',				'"By three methods we may learn wisdom: First, by reflection, which is noblest; Second, by imitation, which is easiest; and third by experience, which is the bitterest."<br /><br />~ Confucious ~',				'"A democracy is nothing more than mob rule, where fifty-one percent of the people may take away the rights of the other forty-nine."<br /><br />~ Thomas Jefferson ~',				'"Government is not reason, it is not eloquence, it is force; like fire, a troublesome servent and a fearful master.  Never for a moment should it be left to irresponsible action."<br /><br />~ George Washington ~',				'"Democracy is the most vile form of government...  democracies have ever been spectacles of turbulence and contention: have ever been found incompatible with personal security or the rights of property: and have in general been as short in their lives as they have been violent in their deaths."<br /><br />~ James Madison ~',				'"The Constitution only guarantees the American people the right to pursue happiness.  You have to catch it yourself."<br /><br />~ Benjamin Franklin ~',				'"Beware the leader who bangs the drum of war in order to whip the citizenry into a patriotic fervor.  For patriotism is indeed a double-edged sword.  It both emboldens the blood, just as it narrows the mind.  And when the drums of war have reached a fever pitch and the blood boils with hate and the mind has closed, the leader will have no need in siezing the rights of the citizenry.  Rather, the citizenry, infused with fear and patriotism, will offer up all of their rights to the leader and gladly so.  How do I know?  For this is what I have done.  And I am Julius Caesar."<br /><br />~ Julius Caesar ~',				'"A man\'s only as old as the woman he feels."<br /><br />~ Groucho Marx ~',				'"Politics have no relation to morals."<br /><br />~ Niccolo Machiavelli ~',				'"Build me a son, O Lord, who will be strong enough to know when he is weak, and brave enough to face himself when he is afraid, one who will be proud and unbending in honest defeat, and humble and gentle in victory."<br /><br />~ General Douglas MacArthur ~',				'"A well regulated militia, composed of the body of the people, trained in arms, is the best most natural defense of a free country."<br /><br />~ James Madison ~',				'"There is no better than adversity.  Every defeat, every heartbreak, every loss contains it\'s own seed, it\'s own lesson on how to improve your performance the next time."<br /><br />~ Malcom X ~',				'"You can lead a man to Congress, but you can\'t make him think."<br /><br />~ Milton Berle ~',				'"There is no meeting of minds, no point of understanding with such terror.  Just a choice: Defeat it or be defeated by it.  And defeat it we must."<br /><br />	 Tony Blair ~',				'"God created man, but I could do better."<br /><br />~ Erma Bombeck ~',				'"In politics stupidity is not a handicap."<br /><br />~ Napoleon Boneparte ~',				'"Look to the future, because that\'s where you\'ll spend the rest of your life."<br /><br />~ George Burns ~',				'"Old age isn\'t so bad when you consider the alternatives."<br /><br />~ Cato ~',				'"Victory at all costs, victory in spite of all terror, victory however long and hard the road may be; for without victory, there is no survival."<br /><br />~ Sir Winston Churchill ~',				'"The two most common elements in the universe are hydrogen and stupidity."<br /><br />~ Harlan Ellison ~',				'"We hang the petty thieves and appoint the great ones to public office."<br /><br />~ Aesop ~',				'"We make war that we may live in peace."<br /><br />~ Aristotle ~',				'"If at first you don\'t succeed, try, try again.  Then quit.  There\'s no point in being a damn fool about it."<br /><br />~ W. C. Fields ~',				'"Any society that would give up a little liberty to gain a little security will deserve neither and lose both."<br /><br />~ Benjamin Franklin ~',				'"The price good men pay for indifference to public affairs is to be ruled by evil men."<br /><br />~ Plato ~',				'"No bastard ever won a war by dying for his country.  He won it by making the other poor dumb bastard die for his country."<br /><br />~ General George S. Patton ~',				'"Arms discourage and keep the invader and plunderer in awe, and preserve order in the world as well as property...Horrid mischief would ensue were [the law-abiding] deprived of the use of them."<br /><br />~ Thomas Paine ~',				'"It is far better to grasp the universe as it really is than to persist in delusion, however satisfying and reassuring."<br /><br />~ Carl Sagan ~',				'"Strength does not come from winning.  Your struggles develop your strengths.  When you go through hardships and decide not to surrender, that is strength."<br /><br />~ Arnold Schwarzenegger ~',				'"Courage is being scared to death...and saddling up anyway."<br /><br />~ John Wayne ~',				'"America stands for liberty, for the pursuit of happiness and for the unalienable right for life.  The right for life cannot be granted or denied by government because it does not come from government, it comes from the creator of life."<br /><br />~ George W. Bush ~',				'"America will never seek a permission slip to defend the security of our people."<br /><br />~ George W. Bush ~',				'"Everywhere that freedom stirs, let tyrants fear."<br /><br />~ George W. Bush ~',				'"Some folks look at me and see a certain swagger, which in Texas is called "Walking."<br /><br />~ George W. Bush ~',				'"States should have the right to enact...laws...particularly to end the inhumane practice of ending a life that otherwise could live."<br /><br />~ George W. Bush ~',				'"The course of this conflict is not known, yet it\'s outcome is certain.  Freedom and fear, justice and cruelty have always been at war, and we know that God is not nuetral between them."<br /><br />~ George W. Bush ~',				'"When I take action, I\'m not going to fire a $2 million missle at a $10 empty tent and hit a camel in the butt.  It\'s going to be decisive."<br /><br />~ George W, Bush ~',				'"I\'m an internationalist.  I\'d like to see our troops dispersed through the world only at the directive of the United Nations."<br /><br />~ John F. Kerry ~',				'"When we, through our educational culture, through the media, through the entertainment culture, give our children the impression that human beings cannot control their passions, we are telling them, in effect, that human beings cannot be trusted with freedom."<br /><br />~ Alan Keyes ~',				'"When I was born I was so surprised I didn\'t talk for a year and a half."<br /><br />~ Gracie Allen ~',				'"Be not afraid."<br /><br />~ Pope John Paul II ~',				'"No...No, you can\'t get away...From ######\'s heart I stab at thee...For hates sake I spit my last breath at thee."<br /><br />~ Khan Noonien Singh ~',				'"They\'re all helpable if they wake up this side of the dirt."<br /><br />~ Dog the Bounty Hunter ~',		  '"An adult faith does not follow the waves of fashion and the latest novelties."<br /><br />~ Pope Benedict XVI ~',		  '"Having a clear faith, based on the creed of the church, is often labeled today as fundamentalism, whereas relativism, which is letting oneself be tossed and swept along by every wind of teaching, looks like the only attitude acceptable to today\'s standards."<br /><br />~ Pope Benedict XVI ~',		  '"What is a moderate interpretation of the test? Halfway between what it really means and what you\'d like it to mean?."<br /><br />~ Antonin Scalia ~',		  '"Hang \'em first, try \'em later."<br /><br />~ Judge Roy Bean ~',				'"In Washington, only two kinds of religion are tolerated: vague beliefs strongly affirmed and stong beliefs vaguely expressed."<br /><br />~ Eugene McCarthy ~',				'"If I have distressing apprehensions..I am supported..by a confidence, that the most gracious Being, who has hitherto watched over the interests and averted the perils of the United States, will never suffer so fair an inheritance speak to become a prey to anarchy, despotism, or any other species of oppression.$#34;<br />< br />~ George Washington, 1789 ~'	  );

Edited by dsonesuk
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...