wtfsmd Posted December 11, 2006 Share Posted December 11, 2006 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 = "<?phpecho '<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 <----Hereecho '<br>'; <----Here$itemnumber = $number; <----Here$item->opacity = 100; <----Here$item->showpuicon; <----Here$link = $item->showpopup ($itemnumber); <----Hereecho $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]<?phpecho '<br>'; = 16908; = 100;; = ();echo [/code]If anyone gets what i am trying to do could you reply to this post please! thank-you. Link to comment https://forums.phpfreaks.com/topic/30209-inserting-php-into-a-text-field-and-submiting-it-into-a-php-page/ Share on other sites More sharing options...
trq Posted December 11, 2006 Share Posted December 11, 2006 This is a bad idea, but take a look at evil [url=http://php.net/eval]eval[/url]. Link to comment https://forums.phpfreaks.com/topic/30209-inserting-php-into-a-text-field-and-submiting-it-into-a-php-page/#findComment-138890 Share on other sites More sharing options...
wtfsmd Posted December 11, 2006 Author Share Posted December 11, 2006 i know its got allot of security issues, is there any other ways to do what i want done? thanks. Link to comment https://forums.phpfreaks.com/topic/30209-inserting-php-into-a-text-field-and-submiting-it-into-a-php-page/#findComment-138893 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.