Jump to content

inserting PhP into a text field and submiting it into a .php page?


wtfsmd

Recommended Posts

i am trying to make it so the user (someone trusted) can type in a simple text field numbers to complete a php script. to be more specifit here: on the right side of the screen there are links to items, i want the person updating the site to be able to insert numbers into a text field here:  (i wrote then instructions on the side that may help you also) anyway they find the number they want to input into the field.  when they put it in and submit it it goes to this page [code]<?php

$data = "
<?php
echo '<br>';
$itemnumber = $number;
$item->opacity = 100;
$item->showpuicon;
$link = $item->showpopup ($itemnumber);
echo $link";
?>
<?php
$number = $_POST['number'];
$filename = "drops.php";
$fp = fopen("$filename","a");
fwrite($fp, $data);

fclose($fp);

?>[/code]

$number is the name of the field where it gets the information.

here is the code that will complete the script. for the hover image.
next to the "<---- HERE!!!" the 16908 should be the information the user types in.

[code]$itemnumber = 16908; <---- HERE!!!
$item->opacity = 100;
$item->showpuicon;
$link = $item->showpopup ($itemnumber);
echo $link;
echo '<br>';[/code]

I want it then to write that php code and post it on the page: [url=http://overdriveguild.com/drops.php]http://overdriveguild.com/drops.php[/url]
which then is included on the index page with the following code
[code]<?php include('./drops.php');
      ?>[/code]

the problem i am having is here

[code]<?php   
$data = "  <----Here
<?php      <----Here
echo '<br>';    <----Here
$itemnumber = $number;    <----Here
$item->opacity = 100;  <----Here
$item->showpuicon;  <----Here
$link = $item->showpopup ($itemnumber);  <----Here
echo $link; <----Here
?>";  <----Here
<?php
$number = $_POST['number'];
$filename = "drops.php";
$fp = fopen("$filename","a");
fwrite($fp, $data);

fclose($fp);

?>[/code]

When it submits the information it screws up the drops.php page and makes it bugged out. here is the code that gets entered:

[code]
<?php
echo '<br>';
= 16908;
= 100;
;
=  ();
echo [/code]

If anyone gets what i am trying to do could you reply to this post please! thank-you.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.