split page into sub pages

Started on the old forum in May 2010 · view the original in the archive · old links redirect here

2 replies · 486 views · started 16 years ago · 1 min read

2 participants
bha Newbie · 2 posts #1

hi guys...

i am new here and this is my first post so anyways here goes...

i have this code what it does is gives the user an option to upload an image, add text to it and then pick a frame for it now my issue is i have over 17 frames and when they display it takes to long to load on mobile phones, so i need to split the frames into atleast4 pages how would you guys do this

<?php

if (isset($_FILES['image_field'])){
		
	$handle = new upload($_FILES['image_field']);
	
	if ($handle->uploaded) {
		if (isset($_POST['image_frame'])) {
			if ($_POST['image_frame']){
				$frame								= $_POST['image_frame'];
			    $handle->image_watermark			= $frame;
			    $handle->image_watermark_position	= 'TL';				    
			} else {
				$frame								= $_FILES['image_field']['tmp_name'];
			}	
			
			$frameinfo 							= getimagesize($frame);
			$newimg_w 							= $frameinfo[0];
			$newimg_h 							= $frameinfo[1];							
		}
			
		$filename=explode('.',$_FILES['image_field']['name']);
		$handle->file_new_name_body   = $filename[0];
		$handle->file_overwrite		  = TRUE;
	    $handle->image_x              = $newimg_w;
	    $handle->image_y              = $newimg_h;
	    $handle->image_ratio_fill     = true;
		$handle->image_resize         = true;	    

	    if ($_POST['image_text']){
		    $handle->image_text				= $_POST['image_text'];
		    $handle->image_text_font		= $_POST['text_font'];
		    $handle->image_text_position	= $_POST['text_position'];
	    }
	    
		//header('Content-type: ' . $handle->file_src_mime);
		//header("Content-Disposition: attachment; filename=".rawurlencode($handle->file_src_name).";");
		$handle->process(getcwd().'/output/');	

	    if ($handle->processed) {
	    	echo '<div class="hd2"><font color=#666666><strong><center> Your Own Personalized Image</center></strong></font></div>'."\n";
	    	echo '<img alt="" src ="output/'.$handle->file_dst_name.'"><br/><br/>';
			echo '<a href="output/'.$handle->file_dst_name.'">Download</a>';
      echo '<br>'."\n";
      echo '	<tr style="font-color:#85859c;"><td style="width:10px;"><img src="Images/Logos/Logo_Back.gif"></td><td>'."\n";
      echo '		<font face="Verdana" size="2"><b><a href="index.php">Back</b></font></a><br>'."\n";
      echo '	</td></tr>'."\n";
echo '<div class="hd5a">';
echo '<div style="display: -wap-marquee; -wap-marquee-loop: 100; font-size: 8pt; color:#666;">Bha Now brings to you the all new and free Nokia security code Generator</div></div>';
      echo '<center>'.$GLOBALS["Advert03"].'</center>'."\n";
      echo '<br>'."\n";
	    	$handle->clean();
	    } else {
	    	echo 'error : ' . $handle->error;
	    }
	}	
	exit;
}

?>
<div class="hd2"><font color=#666666><strong><center>Personalize Your Own Image</center></strong></font></div>

 <form enctype="multipart/form-data" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
	 <table>
		 <tr>
		 	<td>Image:</td><td><input type="file" size="32" name="image_field" value=""></td>
		 </tr>
		  <tr>
		 	<td>Text:</td><td><input type="text" size="32" name="image_text" value=""></td>
		 </tr>
		  <tr>
		 	<td>Font:</td>
		 	<td>
				<select name="text_font">
					<option value="3">1</option>
					<option value="4">2</option>
					<option value="5">3</option>
					<option value="fonts/addlg10.gdf" selected="selected">4</option>
					<option value="fonts/anonymous.gdf">5</option>				
				</select>	 	
		 	</td>
		 </tr>		 
		  <tr>
		 	<td>Text Position: </td>
		 	<td>
				<select name="text_position">
					<option value=""></option>
					<option value="TL">Top Left</option>
					<option value="CL">Middle Left</option>
					<option value="BL">Bottom Left</option>
					<option value="TC">Top Center</option>
					<option value="CC">Middle Center</option>
					<option value="BC" selected="selected">Bottom Center</option>
					<option value="TR">Top Right</option>
					<option value="CR">Middle Right</option>
					<option value="BR">Bottom Right</option>				
				</select>	 	
		 	</td>
		 </tr>
		 <tr>
		 	<td colspan="2"> </td>
		 </tr>		 
		 <tr>
		 	<td colspan="2">Choose frame:</td>
		 </tr>
		 <tr>
		 	<td><input checked="checked" type="radio" name="image_frame" value="" /></td>
		 	<td>None</td>
		 </tr>	 
		 <tr>
		 	<td><input type="radio" name="image_frame" value="frames/frame1.gif" /></td>
		 	<td><img src="frames/frame1.gif" alt="" width="100" /></td>
		 </tr>	 
		 <tr>
		 	<td><input type="radio" name="image_frame" value="frames/frame2.gif" /></td>
		 	<td><img src="frames/frame2.gif" alt="" width="100" /></td>
		 </tr>	 
		 <tr>
		 	<td><input type="radio" name="image_frame" value="frames/frame3.gif" /></td>
		 	<td><img src="frames/frame3.gif" alt="" width="100" /></td>
		 </tr>
		 <tr>
		 	<td><input type="radio" name="image_frame" value="frames/frame4.gif" /></td>
		 	<td><img src="frames/frame4.gif" alt="" width="100" /></td>
		 </tr>	 
		 <tr>
		 	<td><input type="radio" name="image_frame" value="frames/frame5.gif" /></td>
		 	<td><img src="frames/frame5.gif" alt="" width="100" /></td>
		 </tr>	 
		 <tr>
		 	<td><input type="radio" name="image_frame" value="frames/frame6.gif" /></td>
		 	<td><img src="frames/frame6.gif" alt="" width="100" /></td>
		 </tr>
		 <tr>
		 	<td><input type="radio" name="image_frame" value="frames/frame7.gif" /></td>
		 	<td><img src="frames/frame7.gif" alt="" width="100" /></td>
		 </tr>	 
		 <tr>
		 	<td><input type="radio" name="image_frame" value="frames/frame8.gif" /></td>
		 	<td><img src="frames/frame8.gif" alt="" width="100" /></td>
		 </tr>	 
		 <tr>

		 	<td><input type="radio" name="image_frame" value="frames/frame9.gif" /></td>
		 	<td><img src="frames/frame9.gif" alt="" width="100" /></td>
		 </tr>	 
		 <tr>
		 	<td><input type="radio" name="image_frame" value="frames/frame10.gif" /></td>
		 	<td><img src="frames/frame10.gif" alt="" width="100" /></td>
		 </tr>	 
		 <tr>
		 	<td><input type="radio" name="image_frame" value="frames/frame11.gif" /></td>
		 	<td><img src="frames/frame11.gif" alt="" width="100" /></td>
		 </tr>
		 <tr>

		 	<td><input type="radio" name="image_frame" value="frames/frame12.gif" /></td>
		 	<td><img src="frames/frame12.gif" alt="" width="100" /></td>
		 </tr>	 
		 <tr>
		 	<td><input type="radio" name="image_frame" value="frames/frame13.gif" /></td>
		 	<td><img src="frames/frame13.gif" alt="" width="100" /></td>
		 </tr>	 
		 <tr>
	 	<td><input type="radio" name="image_frame" value="frames/frame14.gif" /></td>
		 	<td><img src="frames/frame14.gif" alt="" width="100" /></td>
		 </tr>
		 <tr>

	 	<td><input type="radio" name="image_frame" value="frames/frame15.gif" /></td>
		 	<td><img src="frames/frame15.gif" alt="" width="100" /></td>
		 </tr>
		 <tr>

		 	<td><input type="radio" name="image_frame" value="frames/frame16.gif" /></td>
		 	<td><img src="frames/frame16.gif" alt="" width="100" /></td>
		 </tr>
		 <tr>
	 	<td><input type="radio" name="image_frame" value="frames/frame17.gif" /></td>
		 	<td><img src="frames/frame17.gif" alt="" width="100" /></td>
		 </tr>
		 <tr>

			 	<td><input type="radio" name="image_frame" value="frames/frame18.gif" /></td>
		 	<td><img src="frames/frame18.gif" alt="" width="100" /></td>
		 </tr>
		 <tr>
 	<td colspan="2"><input type="submit" name="Submit" value="Generate"></td>
		 

</tr>	 	 	 
	 </table>
 </form>

<?
      echo '<br>'."\n";
      echo '	<tr style="font-color:#85859c;"><td style="width:10px;"><img src="Images/Logos/Logo_Back.gif"></td><td>'."\n";
      echo '		<font face="Verdana" size="2"><b><a href="../index.php">Back</b></font></a><br>'."\n";
      echo '	</td></tr>'."\n";

?>
bha Newbie · 2 posts #2

anyone i heard this is the best place for help?

something else Fellow · 2,296 posts #3

something like this:

<?php

if (isset($_FILES['image_field'])){
		
	$handle = new upload($_FILES['image_field']);
	
	if ($handle->uploaded) {
		if (isset($_POST['image_frame'])) {
			if ($_POST['image_frame']){
				$frame								= $_POST['image_frame'];
			    $handle->image_watermark			= $frame;
			    $handle->image_watermark_position	= 'TL';				    
			} else {
				$frame								= $_FILES['image_field']['tmp_name'];
			}	
			
			$frameinfo 							= getimagesize($frame);
			$newimg_w 							= $frameinfo[0];
			$newimg_h 							= $frameinfo[1];							
		}
			
		$filename=explode('.',$_FILES['image_field']['name']);
		$handle->file_new_name_body   = $filename[0];
		$handle->file_overwrite		  = TRUE;
	    $handle->image_x              = $newimg_w;
	    $handle->image_y              = $newimg_h;
	    $handle->image_ratio_fill     = true;
		$handle->image_resize         = true;	    

	    if ($_POST['image_text']){
		    $handle->image_text				= $_POST['image_text'];
		    $handle->image_text_font		= $_POST['text_font'];
		    $handle->image_text_position	= $_POST['text_position'];
	    }
	    
		//header('Content-type: ' . $handle->file_src_mime);
		//header("Content-Disposition: attachment; filename=".rawurlencode($handle->file_src_name).";");
		$handle->process(getcwd().'/output/');	

	    if ($handle->processed) {
	    	echo '<div class="hd2"><font color=#666666><strong><center> Your Own Personalized Image</center></strong></font></div>'."\n";
	    	echo '<img alt="" src ="output/'.$handle->file_dst_name.'"><br/><br/>';
			echo '<a href="output/'.$handle->file_dst_name.'">Download</a>';
      echo '<br>'."\n";
      echo '	<tr style="font-color:#85859c;"><td style="width:10px;"><img src="Images/Logos/Logo_Back.gif"></td><td>'."\n";
      echo '		<font face="Verdana" size="2"><b><a href="index.php">Back</b></font></a><br>'."\n";
      echo '	</td></tr>'."\n";
echo '<div class="hd5a">';
echo '<div style="display: -wap-marquee; -wap-marquee-loop: 100; font-size: 8pt; color:#666;">Bha Now brings to you the all new and free Nokia security code Generator</div></div>';
      echo '<center>'.$GLOBALS["Advert03"].'</center>'."\n";
      echo '<br>'."\n";
	    	$handle->clean();
	    } else {
	    	echo 'error : ' . $handle->error;
	    }
	}	
	exit;
}

?>
<div class="hd2"><font color=#666666><strong><center>Personalize Your Own Image</center></strong></font></div>

 <form enctype="multipart/form-data" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
	 <table>
		 <tr>
		 	<td>Image:</td><td><input type="file" size="32" name="image_field" value=""></td>
		 </tr>
		  <tr>
		 	<td>Text:</td><td><input type="text" size="32" name="image_text" value=""></td>
		 </tr>
		  <tr>
		 	<td>Font:</td>
		 	<td>
				<select name="text_font">
					<option value="3">1</option>
					<option value="4">2</option>
					<option value="5">3</option>
					<option value="fonts/addlg10.gdf" selected="selected">4</option>
					<option value="fonts/anonymous.gdf">5</option>				
				</select>	 	
		 	</td>
		 </tr>		 
		  <tr>
		 	<td>Text Position: </td>
		 	<td>
				<select name="text_position">
					<option value=""></option>
					<option value="TL">Top Left</option>
					<option value="CL">Middle Left</option>
					<option value="BL">Bottom Left</option>
					<option value="TC">Top Center</option>
					<option value="CC">Middle Center</option>
					<option value="BC" selected="selected">Bottom Center</option>
					<option value="TR">Top Right</option>
					<option value="CR">Middle Right</option>
					<option value="BR">Bottom Right</option>				
				</select>	 	
		 	</td>
		 </tr>
		 <tr>
		 	<td colspan="2"> </td>
		 </tr>		 
		 <tr>
		 	<td colspan="2">Choose frame:</td>
		 </tr>
		 <tr>
		 	<td><input checked="checked" type="radio" name="image_frame" value="" /></td>
		 	<td>None</td>
		 </tr>

<?
$page = $_GET["page"];
if($page==""){$page=1;}
if($page==1){?>
		 <tr>
		 	<td><input type="radio" name="image_frame" value="frames/frame1.gif" /></td>
		 	<td><img src="frames/frame1.gif" alt="" width="100" /></td>
		 </tr>	 
		 <tr>
		 	<td><input type="radio" name="image_frame" value="frames/frame2.gif" /></td>
		 	<td><img src="frames/frame2.gif" alt="" width="100" /></td>
		 </tr>	 
		 <tr>
		 	<td><input type="radio" name="image_frame" value="frames/frame3.gif" /></td>
		 	<td><img src="frames/frame3.gif" alt="" width="100" /></td>
		 </tr>
		 <tr>
		 	<td><input type="radio" name="image_frame" value="frames/frame4.gif" /></td>
		 	<td><img src="frames/frame4.gif" alt="" width="100" /></td>
		 </tr>	 
		 <tr>
		 	<td><input type="radio" name="image_frame" value="frames/frame5.gif" /></td>
		 	<td><img src="frames/frame5.gif" alt="" width="100" /></td>
		 </tr>	 
<?}else if($page==2){?>
		 <tr>
		 	<td><input type="radio" name="image_frame" value="frames/frame6.gif" /></td>
		 	<td><img src="frames/frame6.gif" alt="" width="100" /></td>
		 </tr>
		 <tr>
		 	<td><input type="radio" name="image_frame" value="frames/frame7.gif" /></td>
		 	<td><img src="frames/frame7.gif" alt="" width="100" /></td>
		 </tr>	 
		 <tr>
		 	<td><input type="radio" name="image_frame" value="frames/frame8.gif" /></td>
		 	<td><img src="frames/frame8.gif" alt="" width="100" /></td>
		 </tr>	 
		 <tr>

		 	<td><input type="radio" name="image_frame" value="frames/frame9.gif" /></td>
		 	<td><img src="frames/frame9.gif" alt="" width="100" /></td>
		 </tr>	 
<?}else if($page==3){?>
		 <tr>
		 	<td><input type="radio" name="image_frame" value="frames/frame10.gif" /></td>
		 	<td><img src="frames/frame10.gif" alt="" width="100" /></td>
		 </tr>	 
		 <tr>
		 	<td><input type="radio" name="image_frame" value="frames/frame11.gif" /></td>
		 	<td><img src="frames/frame11.gif" alt="" width="100" /></td>
		 </tr>
		 <tr>

		 	<td><input type="radio" name="image_frame" value="frames/frame12.gif" /></td>
		 	<td><img src="frames/frame12.gif" alt="" width="100" /></td>
		 </tr>	 
		 <tr>
		 	<td><input type="radio" name="image_frame" value="frames/frame13.gif" /></td>
		 	<td><img src="frames/frame13.gif" alt="" width="100" /></td>
		 </tr>	 
		 <tr>
	 	<td><input type="radio" name="image_frame" value="frames/frame14.gif" /></td>
		 	<td><img src="frames/frame14.gif" alt="" width="100" /></td>
		 </tr>
		 <tr>

	 	<td><input type="radio" name="image_frame" value="frames/frame15.gif" /></td>
		 	<td><img src="frames/frame15.gif" alt="" width="100" /></td>
		 </tr>
<?}else if($page==4){?>
		 <tr>

		 	<td><input type="radio" name="image_frame" value="frames/frame16.gif" /></td>
		 	<td><img src="frames/frame16.gif" alt="" width="100" /></td>
		 </tr>
		 <tr>
	 	<td><input type="radio" name="image_frame" value="frames/frame17.gif" /></td>
		 	<td><img src="frames/frame17.gif" alt="" width="100" /></td>
		 </tr>
		 <tr>

			 	<td><input type="radio" name="image_frame" value="frames/frame18.gif" /></td>
		 	<td><img src="frames/frame18.gif" alt="" width="100" /></td>
		 </tr>
<?}?>

		 <tr>
 	<td colspan="2"><input type="submit" name="Submit" value="Generate"></td>
		 

</tr>	 	 	 
	 </table>
 </form>

<?
$npage=$page+1;
$ppage=$page-1;
echo "More Frame Choices In Next Pages<br/>";
if($page!=4){
echo "<a href=\"$_SERVER['PHP_SELF']?page=$npage\">Next</a><br/>";
}
if($page!=1){
echo "<a href=\"$_SERVER['PHP_SELF']?page=$ppage\">Previous</a><br/>";
}

      echo '<br>'."\n";
      echo '	<tr style="font-color:#85859c;"><td style="width:10px;"><img src="Images/Logos/Logo_Back.gif"></td><td>'."\n";
      echo '		<font face="Verdana" size="2"><b><a href="http://coding-talk.com/f14/index.php">Back</b></font></a><br>'."\n";
      echo '	</td></tr>'."\n";

?>

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close