bluewalrus
10-20-2008, 07:00 PM
I have this page http://www.bluewalrus.net/testing.php. Which comes from this page http://www.bluewalrus.net/log.html. Its suppose to write code for a web page based on how many photos the user inputs but right now its ignoring the number and just keeps writing no stopping. Also the if statement above isn't working either so I don't know if theres something wrong with my declarations at the top or if its something else? Any suggestions I appreciate the php is below. Also if you go to test it the username and password don't matter yet i'm going to add those in later so you can put anything you want or nothing.
<?php
$user = $_POST['user'];
$pass = $_POST['password'];
$event = $_POST['event'];
$maxnum = $_POST['totalphotos'];
$bp = $_POST['bigpic'];
$num = 01;
print '<link rel="stylesheet" type="text/css" href="/Agov3/scripts/box/css/lightbox.css"></link> <p><script type="text/javascript" src="Agov3/scripts/box/js/prototype.js"><!--//--></script><script type="text/javascript" src="Agov3/scripts/box/js/scriptaculous.js?load=effects,builder"><!--//--></script><script type="text/javascript" src="Agov3/scripts/box/js/lightbox.js"><!--//--></script>TEXT ABOUT EVENT</p><p><a title="" href="?pageID=gov3terminal&L=3&L0=Home&L1=Media+Center&L2=Videos&sid=Agov3&b=terminalcontent&f=videos_&csid=Agov3" target="_self"><img title="" height="15" alt="" hspace="2" src="http://www.mass.gov/Agov3/images/video_icon.GIF" width="14" border="0" /></a> <a title="" href="?pageID=gov3terminal&L=3&L0=Home&L1=Media+Center&L2=Videos&sid=Agov3&b=terminalcontent&f=videos_' . $event . '&csid=Agov3" target="_self">Go to the video from this event</a><br /><a title="" href="?pageID=gov3subtopic&L=4&L0=Home&L1=Key+Priorities&L2=World-Class+Education+-+The+Readiness+Project&L3=The+Commonwealth+Readiness+Project&sid=Agov3" target="_self"><img title="transcript icon" height="15" alt="transcript icon" hspace="2" src="http://www.mass.gov/Agov3/images/complete_text_icon.gif" width="14" border="0" /></a> <a href="?pageID=gov3subtopic&L=4&L0=Home&L1=Key+Priorities&L2=World-Class+Education+-+The+Readiness+Project&L3=The+Commonwealth+Readiness+Project&sid=Agov3" target="_self">Learn more about the Readiness Project and read the final reports</a><br /><a title="" href="?pageID=gov3terminal&L=3&L0=Home&L1=Media+Center&L2=Speeches&sid=Agov3&b=terminalcontent&f=text_' . $event . '&csid=Agov3" target="_blank"><img title="transcript icon" height="15" alt="transcript icon" hspace="2" src="http://www.mass.gov/Agov3/images/complete_text_icon.gif" width="14" border="0" /></a> <a href="?pageID=gov3terminal&L=3&L0=Home&L1=Media+Center&L2=Speeches&sid=Agov3&b=terminalcontent&f=text_' .$event . '&csid=Agov3" target="_blank">Read the transcript of the speech</a> (opens in a new window)<br /><a title="" href="?pageID=gov3pressrelease&L=1&L0=Home&sid=Agov3&b=pressrelease&f=080625_education_reform3&csid=Agov3" target="_blank"><img title="transcript icon" height="15" alt="transcript icon" hspace="2" src="http://www.mass.gov/Agov3/images/complete_text_icon.gif" width="14" border="0" /></a> <a href="?pageID=gov3pressrelease&L=1&L0=Home&sid=Agov3&b=pressrelease&f=080625_education_reform3&csid=Agov3" target="_blank">Read the press release</a><br /></p>';
if ($bp = "Yes") {
print '<h4>The "Big Picture"</h4><p>View a panoramic picture of the event. </p><table width="100%"><tbody><tr><td> <a title="" href="Agov3/images/' . $event . '_bp.jpg" rel="lightbox[roadtrip]"><img title="A panoramic view of the event." alt="A panoramic view of the event." src="/Agov3/images/' . $event .'_bplk.jpg" border="0" /></a></td></tr></tbody></table><br />';
}
while ( $num <= $maxnum )
{
print '<p>Click photo to open larger version.  Right-click photo to download and save.<br /></p><table bordercolor="#c0c0c0" cellpadding="2" width="100%" border="1"><tbody><tr><td><a title="Info about photo" href="Agov3/images/' . $event . $num . 'lb.jpg" rel="lightbox[roadtrip]"><img title="Info about photo" height="133" alt="Info about photo" src="/Agov3/images/' . $event . $num . 'lk.jpg" width="200" border="0" /></a><center><a href="Agov3/images/' . $event . $num . 'web.jpg" target="_blank">Full Res</a></center></td><td>Info about photo</td></tr></tbody></table>';
}
?>
<?php
$user = $_POST['user'];
$pass = $_POST['password'];
$event = $_POST['event'];
$maxnum = $_POST['totalphotos'];
$bp = $_POST['bigpic'];
$num = 01;
print '<link rel="stylesheet" type="text/css" href="/Agov3/scripts/box/css/lightbox.css"></link> <p><script type="text/javascript" src="Agov3/scripts/box/js/prototype.js"><!--//--></script><script type="text/javascript" src="Agov3/scripts/box/js/scriptaculous.js?load=effects,builder"><!--//--></script><script type="text/javascript" src="Agov3/scripts/box/js/lightbox.js"><!--//--></script>TEXT ABOUT EVENT</p><p><a title="" href="?pageID=gov3terminal&L=3&L0=Home&L1=Media+Center&L2=Videos&sid=Agov3&b=terminalcontent&f=videos_&csid=Agov3" target="_self"><img title="" height="15" alt="" hspace="2" src="http://www.mass.gov/Agov3/images/video_icon.GIF" width="14" border="0" /></a> <a title="" href="?pageID=gov3terminal&L=3&L0=Home&L1=Media+Center&L2=Videos&sid=Agov3&b=terminalcontent&f=videos_' . $event . '&csid=Agov3" target="_self">Go to the video from this event</a><br /><a title="" href="?pageID=gov3subtopic&L=4&L0=Home&L1=Key+Priorities&L2=World-Class+Education+-+The+Readiness+Project&L3=The+Commonwealth+Readiness+Project&sid=Agov3" target="_self"><img title="transcript icon" height="15" alt="transcript icon" hspace="2" src="http://www.mass.gov/Agov3/images/complete_text_icon.gif" width="14" border="0" /></a> <a href="?pageID=gov3subtopic&L=4&L0=Home&L1=Key+Priorities&L2=World-Class+Education+-+The+Readiness+Project&L3=The+Commonwealth+Readiness+Project&sid=Agov3" target="_self">Learn more about the Readiness Project and read the final reports</a><br /><a title="" href="?pageID=gov3terminal&L=3&L0=Home&L1=Media+Center&L2=Speeches&sid=Agov3&b=terminalcontent&f=text_' . $event . '&csid=Agov3" target="_blank"><img title="transcript icon" height="15" alt="transcript icon" hspace="2" src="http://www.mass.gov/Agov3/images/complete_text_icon.gif" width="14" border="0" /></a> <a href="?pageID=gov3terminal&L=3&L0=Home&L1=Media+Center&L2=Speeches&sid=Agov3&b=terminalcontent&f=text_' .$event . '&csid=Agov3" target="_blank">Read the transcript of the speech</a> (opens in a new window)<br /><a title="" href="?pageID=gov3pressrelease&L=1&L0=Home&sid=Agov3&b=pressrelease&f=080625_education_reform3&csid=Agov3" target="_blank"><img title="transcript icon" height="15" alt="transcript icon" hspace="2" src="http://www.mass.gov/Agov3/images/complete_text_icon.gif" width="14" border="0" /></a> <a href="?pageID=gov3pressrelease&L=1&L0=Home&sid=Agov3&b=pressrelease&f=080625_education_reform3&csid=Agov3" target="_blank">Read the press release</a><br /></p>';
if ($bp = "Yes") {
print '<h4>The "Big Picture"</h4><p>View a panoramic picture of the event. </p><table width="100%"><tbody><tr><td> <a title="" href="Agov3/images/' . $event . '_bp.jpg" rel="lightbox[roadtrip]"><img title="A panoramic view of the event." alt="A panoramic view of the event." src="/Agov3/images/' . $event .'_bplk.jpg" border="0" /></a></td></tr></tbody></table><br />';
}
while ( $num <= $maxnum )
{
print '<p>Click photo to open larger version.  Right-click photo to download and save.<br /></p><table bordercolor="#c0c0c0" cellpadding="2" width="100%" border="1"><tbody><tr><td><a title="Info about photo" href="Agov3/images/' . $event . $num . 'lb.jpg" rel="lightbox[roadtrip]"><img title="Info about photo" height="133" alt="Info about photo" src="/Agov3/images/' . $event . $num . 'lk.jpg" width="200" border="0" /></a><center><a href="Agov3/images/' . $event . $num . 'web.jpg" target="_blank">Full Res</a></center></td><td>Info about photo</td></tr></tbody></table>';
}
?>