View Single Post
  #1  
Old 03-18-2006, 07:29 PM
King Kovifor's Avatar
King Kovifor King Kovifor is offline
 
Join Date: Nov 2004
Location: PA
Posts: 3,872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default I'm trying to create a form...

OK I'm trying to create a form that'll create a php code section in a specified php file... but I get
Quote:
Parse error: syntax error, unexpected T_CHARACTER, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/jeremy/public_html/kkgraphics/write_img_info.php on line 3
when I click submit... can someone please look at my code and see if I've got any mistakes:

FORM (new_image_form.html):

HTML Code:
<form name="add_img_info" method="post" action="write_img_info.php">
  <table width="100%" border="0" cellpadding="5" cellspacing="0">
	<tr>
		<td align="left" valing="top">
			<strong>Image ID (please add one to the last image id):</strong>
		</td>
		<td align="left">
			<input name="img_id" type="text" value="Image ID" />
	<tr>
		<td align="left" valign="top">
			<strong>Image Url:</strong>
		</td>
		<td align="left">
			<input name="img_url" type="text" value="Image URL" />
		</td>
	</tr>
	<tr>
		<td align="left" valign="top">
			<strong>Image Alt:</strong>
		</td>
		<td align="left">
			<input name="img_alt" type="text" value="Image Alt" />
		</td>
	</tr>
	<tr>
		<td align="left" valign="top">
			<strong>Image Name:</strong>
		</td>
		<td align="left">
			<input name="img_name" type="text" value="Image Name" />
		</td>
	</tr>
	<tr>
		<td align="left" valign="top">
			<strong>Image Height:</strong>
		</td>
		<td align="left">
			<input name="img_height" type="text" value="Image Height" />
		</td>
	</tr>
	<tr>
		<td align="left" valign="top">
			<strong>Image Width:</strong>
		</td>
		<td align="left">
			<input name="img_width" type="text" value="Image Width" />
		</td>
	</tr>
	<tr>
		<td align="left" valign="top">
			<strong>Image Category:</strong>
		</td>
		<td align="left">
			<input name="img_category" type="text" value="Image Category" />
		</td>
	</tr>
	<tr>
		<td align="left" valign="top">
			<strong>Image Release Date:</strong>
		</td>
		<td align="left">
			<input name="img_release" type="text" value="Image Release Date" />
		</td>
	</tr>
	<tr>
		<td align="left" valign="top">
			<strong>Downloadable For Personal Use?</strong>
		</td>
		<td align="left">
			<input name="img_download" type="text" value="Yes or No?" />
		</td>
	</tr>
	<tr>
		<td align="left" valign="top">
			<strong>Image Version:</strong>
		</td>
		<td align="left">
			<input name="img_version" type="text" value="Image Version" />
		</td>
	</tr>
    <tr>
      <td align="center" valign="middle" colspan="2">
        <br /><input type="submit" name="add_img_info" value="Submit!" />
      </td>
    </tr>
</table>
</form>
write_img_info.php (PHP Script to write php code!):

PHP Code:
<?php 
$content 
"<?php/n
//############################{ .
$_POST[\"img_name\"]. }###########################/n
if (
$_REQUEST['id'] == '.$_POST[\"img_id\"].')
/n{
/n
$img_url=\".$_POST[\"img_url\"].\"
/n
$alt=\".$_POST[\"img_alt\"].\"
/n
$name=\".$_POST[\"img_name\"].\"
/n
$height=\".$_POST[\"img_height\"].\"
/n
$width=\".$_POST[\"img_width\"].\"
/n
$category=\".$_POST[\"img_category\"].\"
/n
$release=\".$_POST[\"img_release\"].\"
/n
$download=\".$_POST[\"img_download\"].\"
/n
$version=\".$_POST[\"img_version\"].\"
/n}
/n?>"
;
$fp fopen("image_info.php","wb"); 
fwrite($fp,$content); 
fclose($fp); 
?>
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01418 seconds
  • Memory Usage 1,813KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete