...

View Full Version : PHP include



ccarrin2
03-01-2012, 04:17 PM
I would like to somehow put this entire form into another file named image-form.php. I think I need an include statement but I'm not too sure. How do I go about doing that? Thank you



<div id="mngl-upload-photo-tab" class="mngl-profile-tab mngl-hidden">
<div style="color:#171717; font-weight:bold;">Upload Your Running Pictures Here >> 10 Image Limit per Upload</div><p>

<!-- In another file -->
<form action="upload.php" method="post" enctype="multipart/form-data" name="uploadform">
<input type="hidden" name="MAX_FILE_SIZE" value="350000">
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr style="display:none"><td width="102"><strong>User ID:</strong></td>
<td width="256" align="left"><input name="user_id" value="<?php echo $mngl_user->id; ?>" type="text" id="user_id" size="25"></td>
<td width="256" align="left"><input name="user_name" value="<?php echo $mngl_user->first_name; ?>" type="text" id="user_name" size="5"></td>
<td width="142" align="left">&nbsp;</td></tr><tr><td width="102"><strong>Image 1 File:</strong></td>
<td width="256" align="left"><input name="picture1" type="file" id="picture1" size="25"></td>
<td width="142" align="right"><input name="add" type="button" onClick="toggle_visibility('image_two')" value="Add Another Image"></td></tr></table>

<br /><table width="500" border="0" cellspacing="0" cellpadding="0">
<tr><td><input type="reset" value="Reset"></td>
<td align="right"><input name="upload" type="submit" id="upload" value="Upload Images"></td></tr></table></form>
<!-- In another file -->

</div>

Keleth
03-01-2012, 04:21 PM
Put whatever content you want into the other file, then just use the include function, pointing to the file... it'll take whatever is in the file, and place it into the current. Its just what you said/thought.

bobgodwin
03-03-2012, 05:14 AM
include 'image-form.php';
Put it where ever you want it to show up.

Dan13071992
03-03-2012, 10:55 AM
include 'image-form.php';
Put it where ever you want it to show up.

there is another way, i dont think it matters but i use this way cause its how i learnt to do it:



include('image-form.php');



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum