PHP - Html Editor Form?
Hi,
Im making a sort of blogger module for a Zen Cart plug-in so that the front page can be used as a news page which would be good for SEO. I have everything working, except for a HTML editor, as I need the user to be able to create the pages in the same sort of way you make the description for an ebay listing. I have looked on google, but couldnt find anything. Could anyone help me with this? Thanks! Similar TutorialsI hope it is appropriate to ask this here?
Does anyone know of a WYSIWYG HTML editor that can be integrated into a web site (PHP/MYSQL based Bulletin Board), that has code synthax highlighting/display capabilities?
Kindly recommend as i wish to integrate one into my custom built bulletin board.
Thanks
This topic has been moved to Website Critique. http://www.phpfreaks.com/forums/index.php?topic=355553.0 Hi all, I have an html form that sends formdata to a php script called example.php with the POST method. example.php then has the following structu Code: [Select] <?php if(isset($_POST['var1'])) {$var1 = $_POST['var1'];} else {$var1 = 'English';} if(isset($_POST['var2'])) {$var2 = $_POST['var2'];} else {$var2 = 'French';} print" <html> <body> <form> <select id='select1'> <option>var1</option> <option>var2</option> <option>etc...</option> </select> <input type='text' id='input1'> ETC. ETC. </form> </body> </html> "; ?> So example.php has an embedded html form. How do I specify that some elements of the form should take their values from the variables retrieved at the start of the script via the POST command? For example, I want select1 to have 'var1' pre-selected and I want input1 to display var2. var1 & var2 get sent through to example.php fine, I just don't know how to get the embedded html form to use them. Please help! Thanks a lot. There are two pieces to this- The HTML Form and the resulting php. I can't seem to make the leap, from the code to having the form produce the php page so others can view it until the form is again submitted overwriting the php, thus generating new content. The environment I am working in is limited to IIs 5.1 and php 5.2.17 without mySQL or other DB I'm new to php, this isn't homework,or commercialization, it's for children. I am thinking perhaps fwrite / fread but can't get my head around it. Code snipets below. Any help, please use portions of this code in hopes I can understand it Thanks Code snipet from Output.php Code: [Select] <?php $t1image = $_POST["t1image"]; $t1title = $_POST["t1title"]; $t1info = $_POST["t1info"]; $t2image = $_POST["t2image"]; $t2title = $_POST["t2title"]; $t2info = $_POST["t2info"]; ?> ... <tbody> <tr><!--Headers--> <td style="vertical-align: top; text-align: center; background-color: rgb(204, 255, 255);">Animal</td> <td style="vertical-align: top; text-align: center; background-color: rgb(204, 255, 255);">Image thumb<br> </td> <td style="vertical-align: top; text-align: center; background-color: rgb(204, 255, 255);">Date<br> </td> <td style="vertical-align: top; text-align: center; background-color: rgb(204, 255, 255);">Information<br> </td> </tr> <tr> <td style="vertical-align: top; text-align: center;">Monkey </td> <td style="vertical-align: top; text-align: center;"><img src="<?php echo $t1image.'.gif'; ?>"><!--single image presented selected from radio buttons--> </td> <td style="vertical-align: top; text-align: center;"><?php echo date("m/d/Yh:i A"); ?><!--time stamp generated when submitted form populates all fields at once--> </td> <td style="vertical-align: top; text-align: center;"><a href="#monkey" rel="facebox"><?php echo $t1title ?></a><!--Link name provided by "Title 1", that links to hidden Div generated page with content from "Info1" field--> <div id="Monkey" style="display:none"> <?php echo $t1info; ?> </div> </td> </tr> <tr> <td style="vertical-align: top; text-align: center;">Cat<br> </td> <td style="vertical-align: top; text-align: center;"><img src="<?php echo $t2image.'.gif'?>"></td> <td style="vertical-align: top; text-align: center;"><?php echo date("m/d/Yh:i A"); ?></td> <td style="vertical-align: top; text-align: center;"><a href="#Cat" rel="facebox"><?php echo $t2title ?></a> <div id="Cat" style="display:none"> <?php echo $t2info; ?> </div> </td> </tr> <tr> This replicates several times down the page around 15-20 times ( t1### - t20###) Code Snipet from HTML Form Code: [Select] <form action="animals.php" method="post"> <div style="text-align: left;"><big style="font-family: Garamond; font-weight: bold; color: rgb(51, 51, 255);"><big><big><span>Monkey</span></big></big></big><br> <table style="text-align: left; width: 110px;" border="0" cellpadding="2" cellspacing="0"> <tbody><tr> <td style="vertical-align: top;">Image thumb<br> <input type="radio" name="t1image" value="No opinion" checked><img src="eh.gif" alt="Eh"> <input type="radio" name="t1image" value="Ok"><img src="ok.gif" alt="ok"> <input type="radio" name="t1image" value="Like"><img src="like.gif" alt="Like"> <input type="radio" name="t1image" value="Dont"><img src="dont.gif" alt="Don't Like"> <input type="radio" name="t1image" value="Hate"><img src="hate.gif" alt="Hate"> <input type="radio" name="t1image" value="Other"><img src="other.gif" alt="Other"> <br> Why Title:<input type="text" name="t1title" size="45" value="..."/></td> <td style="vertical-align: top;"> Explain:<br> <textarea name="t1info" cols=45 rows=3 value="..."></textarea> </td></tr></table> <br> <!--Next--> How do I get the Form data to save to the php page for others to view? I'm trying to submit html/php code through an html form and then insert it into a mysql database. I've got the following code so far (without the insert into database query), however when I submit the form I get pushed through to my 403 page. If i comment out the textarea that contains the code I am trying to submit, then it goes through fine. Any ideas? Code: [Select] <? if (isset($_POST['optone'])) {$optone=$_POST['optone']; $opttwo=$_POST['opttwo'];} if (isset($_POST['type'])) {if ($_POST['type']=='Theory') {$optone=1;} if ($_POST['type']=='Demo') {$optone=2;} $opttwo=$_POST['module'];} ?> <h3>Module administration</h3> <script> function setOptions(chosen) { var selbox = document.myform.opttwo; selbox.options.length = 0; if (chosen == " ") { selbox.options[selbox.options.length] = new Option('Please select an option first',' '); document.myform.go.disabled=true; } if (chosen == "1") { selbox.options[selbox.options.length] = new Option('Module 1','1'); selbox.options[selbox.options.length] = new Option('Module 2','2'); selbox.options[selbox.options.length] = new Option('Module 3','3'); selbox.options[selbox.options.length] = new Option('Module 4','4'); selbox.options[selbox.options.length] = new Option('Module 5','5'); selbox.options[selbox.options.length] = new Option('Module 6','6'); selbox.options[selbox.options.length] = new Option('Module 7','7'); selbox.options[selbox.options.length] = new Option('Module 8','8'); selbox.options[selbox.options.length] = new Option('Module 9','9'); selbox.options[selbox.options.length] = new Option('Module 10','10'); document.myform.go.disabled=false; } if (chosen == "2") { selbox.options[selbox.options.length] = new Option('Module 1','1'); selbox.options[selbox.options.length] = new Option('Module 2','2'); selbox.options[selbox.options.length] = new Option('Module 3','3'); selbox.options[selbox.options.length] = new Option('Module 4','4'); selbox.options[selbox.options.length] = new Option('Module 5','5'); selbox.options[selbox.options.length] = new Option('Module 6','6'); selbox.options[selbox.options.length] = new Option('Module 7','7'); selbox.options[selbox.options.length] = new Option('Module 8','8'); selbox.options[selbox.options.length] = new Option('Module 9','9'); selbox.options[selbox.options.length] = new Option('Module 10','10'); document.myform.go.disabled=false; } } </script> <br /> <center> <form name="myform" method='post'> Edit: <select id="optone" name="optone" size="1" onchange="setOptions(document.myform.optone.options[document.myform.optone.selectedIndex].value);" > <option value=" " >--Choose--</option> <option value="1" >Theory</option> <option value="2" >Demo</option> </select> <select name="opttwo" size="1"> <option value=" " selected="selected">Please select an option first</option> </select> <input type='submit' name='go' id='go' value='Go' disabled='disabled'/> </form> </center> <br /><br /> <? if (isset($opttwo)) { if ($optone==1) {$query = "SELECT info,userscompleted,last_user,enabled FROM theorydata WHERE TheoryID=".$opttwo; $typestr='Theory'; $texthelp='Code must be entered in HTML';} if ($optone==2) {$query = "SELECT info,userscompleted,last_user,enabled FROM demodata WHERE DemoID=".$opttwo; $typestr='Demo'; $texthelp='Code must be entered in PHP';} $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result); $query2="SELECT full_name FROM users WHERE id=".$row['last_user']; $result2 = mysql_query($query2) or die(mysql_error()); $row2 = mysql_fetch_array($result2); ?> <form method='post' > <table> <tr> <td align='center'> Type: </td> <td> <input type='text' name='type' readonly='readonly' value="<? echo $typestr; ?>" /> </td> </tr> <tr> <td align='center'> Module: </td> <td> <input type='text' name='module' readonly='readonly' value="<? echo $opttwo; ?>" /> </td> </tr> <tr> <td align='center' > Enabled? </td> <td> <select name='enabled'> <option value='yes' <? if ($row['enabled'] == '1') {echo "selected='selected'";}?> >Yes</option> <option value='no' <? if ($row['enabled'] == '0') {echo "selected='selected'";}?> >No</option> </select> </td> </tr> <tr> <td align='center'> Code: </td> <td> <center><font color='red'><? echo $texthelp; ?></font></center> <textarea name='info' rows=35 cols=80><? echo htmlentities($row['info']); ?></textarea> </td> </tr> <tr> <td align='center' > Users completed: </td> <td> <input type='text' name='userscompleted' value="<? echo $row['userscompleted']; ?>" size=4/> </td> </tr> <tr> <td align='center' > Last user: </td> <td> <input type='text' name='last_user' readonly='readonly' value="<? echo $row2['full_name']; ?>" /> </td> </tr> <tr> <td></td> <td align='center'> <input type='submit' value='Edit'/> </td> </tr> </table> </form> <? }//close isset(opttwo) ?> Hello! I have spent days and days trying to search for some scripts to help me with my goal of making a user friendly XML editor to no avail. Here is the situation: I built a flash image slideshow for a client. This slideshow uses the following XML: Code: [Select] <?xml version="1.0" encoding="utf-8"?> <SLIDESHOW SPEED="4"> <IMAGE URL="slideShowImages/image1.jpg" TITLE="The first Image" /> <IMAGE URL="slideShowImages/image2.jpg" TITLE="The second Image" /> <IMAGE URL="slideShowImages/image3.jpg" TITLE="The third Image" /> </SLIDESHOW> I have been looking for a way to both upload a new image to the server in the /slideShowImages/ folder, and add a new entry to the XML above. Also, I want the ability to delete a node from the list and remove the corresponding image from the server. Basically I want to make a CMS for a flash based slideshow. any help would be simply amazing. Thanks in advance, James Hi im having an issue with this simple file editor...it displays the html file but its all greyed out and uneditable and can't press submit please help!
Attached Files
editor.php 14.66KB
1 downloads
submiteditor.php 1.83KB
0 downloads hi, how can i add a pantone like this http://img.pai.pt/mysite/rendermedia/42/45/2/192881b9-8e84-44ff-b109-bac29d7726de_LARGE.jpg ? thanks for your help This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=323321.0 Hi there, I have form to send newsletter and I use text encoding not HTML. Do you know the best editor to make BOLD or Space when i write email. I don't need HTML editor I need for text . Thanks Hi there, i have a problem regarding a editor that I am building, I am fairly new to php, but this is what i have so far: Code: [Select] <?php $dirname = "."; $dir = opendir($dirname); ?> <form action="editor.php" method="POST"> <select> <?php while(false != ($file = readdir($dir))) if (strpos($file, '.php',1)||strpos($file, '.html',1)||strpos($file, '.css',1) ) { { if(($file != ".") and ($file != "..")) { echo("<option><a href='$file'>$file</a></option>"); } }} ?> </select> <input type="submit" value="Submit" /> </form> <br /> <center> <form > <textarea rows="80" cols="130"> <?php include $_POST["$file"]; ?> </textarea> </center> The code produces a drop down list of any html, php or css files in the current directory and I want it to be able to show the selected file from the drop down list in the textarea so that I can edit it, I also am not sure how to save the file, would this be a file write method? any help would really be appreciated as I've been stuck on this issue for hours an its doing my nut in!!! Thanks SF my issue is to show preview of a form. the form will have a fck editor . this form is used to update a table. i need to show a preview button on this page and when we click on it should show the preview of the content. i am attaching my code. my problem is this is a update page fck value is taken from Dn "$desc" . when do some changes on editor then i click on preview button should show the changes, here showing only the $dec value from DB not the value i change. <?php session_start(); $uname=$_SESSION['usname']; include("dbconnect.php"); $admin_qry="select * from st_admin where admin_username='$uname'"; $res=mysql_query($admin_qry); $admin_res=mysql_fetch_array($res); $level=$admin_res['level']; include("status.php"); ?> <script language="javascript" src="ajax/ajax.js"></script><?php $pos=$_REQUEST['pos2']; $getqry="select * from st_aboutus where categorys='$pos'"; $resr=mysql_query($getqry); $row=mysql_fetch_array($resr); $cat=$row['categorys']; $img=$row['st_img']; //$description=$row['st_content']; $desc=stripslashes($row['st_content']); $file_name=$row['file_name']; $id=$row['st_id']; ?> <script language="javascript"> function popUpPreview() { // Display a new browser for the user var w = screen.availWidth / 2 - 450; var h = screen.availHeight / 2 - 320; var win = window.open('aboutus-prewiew.php', 'payPopupMain', 'width=900,height=650,left='+w+',top='+h+',scrollbars=1'); } </script> <link href="../css/style.css" rel="stylesheet" type="text/css" /> <form name="sform" id="sform" action="update_aboutus.php" method="post"> <table width="679" height="323" border="0" align="center" cellpadding="0" cellspacing="0" > <tr> <td colspan="5" height="40" align="left" class="page_head" valign="top"> </td> </tr> <tr> <td align="left" class="textfont"> </td> <td align="left" class="textfont"> </td> <td height="40" align="left"> </td> <td height="40" align="left" class="normaltext"><?php if($level=="dataentry" ){} else {echo " Status " ; } ?></td> <td align="left"><span style="padding-left:10px;"> <?php if($level=="dataentry" ){} else { showStatus('st_aboutus','st_id','status',$id) ; } ?> </span></td> </tr> <tr> <td width="170" align="left" class="textfont"> </td> <td width="8" align="left" class="textfont"> </td> <td height="40" colspan="3" align="left"><?php echo $message=$_GET[msg]; ?></td> </tr> <tr> <td height="19" class="listitem" align="right"> </td> <td class="listitem" align="left"> </td> <td height="19" align="left" class="listitem1">Image Size 274 X 420</td> <td colspan="2" align="left"></td> </tr> <tr> <td height="71" class="listitem" align="right">Add Image</td> <td class="listitem" align="left"> </td> <td width="236" height="71" align="left"><input name="logo" type = "text" id="logo" value="<?php echo $img; ?>" size="20" readonly="readonly" class="txtbox" /> <img src="../images/attach.gif" onClick="attachment('logo','logoimage')" class="imagebutton12" /> <img src="../images/remove.gif" onClick="removeattachment('logo','logoimage')" class="imagebutton12" /></td> <td width="265" colspan="2" align="left"><img src="<?php if($img) {echo "aboutus/".$img; } else { echo "../images/photo.gif "; } ?>" width="67" height="62" name="logoimage8" id="logoimage" /> <input type="hidden" name="image1_hiid" id="image1_hiid" value="<?php echo $img; ?>" /></td> </tr> <tr> <td colspan="5" align="left" class="optimumSize" valign="bottom"><!--Optimum size of image is 120 X 105 --></td> </tr> <tr> <td height="10" colspan="2" class="textfont"> </td> <td height="10" colspan="3"><?php include("../FCKeditor/fckeditor.php"); $oFCKeditor = new FCKeditor('desc') ; $oFCKeditor->BasePath = '../FCKeditor/'; /* $oFCKeditor->Value =stripslashes(substr($intro,0,500));*/ $oFCKeditor->Value = $desc; // here we can give size of editor as $oFCKeditor->Width = '600' ; $oFCKeditor->Height = '250' ; $oFCKeditor->Create() ; ?></td> </tr> <tr> <td height="27" align="right" class="listitem"> </td> <td height="27" class="textfont"> </td> <td height="27" align="left" valign="bottom"><span class="listitem1"><?php /*?><?php if($pos!="management" ){} else {echo " Only Upload ".pdf" file";} ?><?php */?></span></td> <td height="27" colspan="2" align="left"> </td> </tr> <?php /*?><?php if($pos!="management" ){} else {echo " <tr> <td height='68' align='right' class='listitem'>Update pdf</td> <td height='68' class='textfont'> </td> <td height='68' align='left'> <input name='logo1' type = 'text' id='logo1' value='$file_name' size='20' readonly='readonly' class='txtbox' /> <img src='../images/attach.gif' onclick=\"attachment('logo1','logoimage1')\" class='imagebutton12' /> <img src='../images/remove.gif' onclick=\"removeattachment('logo1','logoimage1')\" class='imagebutton12' /></td> <td height='68' align='left'><img src=\"aboutus/$file_name\" width='67' height='62' name='logoimage1' id='logoimage1' /></td> </tr> ";} ?><?php */?> <tr> <td height="36" colspan="2"><input type="hidden" name="des" id="des" value="<?php echo $img; ?>" /></td> <td align="left"><input name="preview" type="button" onclick="return popUpPreview();" value="Preview"/></td> <td colspan="2"> </td> </tr> <tr> <td colspan="2"><input type="hidden" name="id" value="<?php echo $id; ?>"><input type="hidden" name="pos" value="<?php echo $pos; ?>"> <input type="hidden" name="image1_hiid1" id="image1_hiid1" value="<?php echo $file_name; ?>" /></td> <td align="left"> <input type="image" name="image" value="Submit" src="../images/submit.gif" alt="Login Details" title="Submit" onclick="return fieldcheck(this.form);"></td> <td colspan="2"> </td> </tr> <tr><td colspan="5" height="10"></td></tr> </table> </form> aboutus-prewiew.php <script type="text/javascript"> document.write(opener.document.sform.logo.value); document.write(opener.document.sform.desc.value); // this value only showing from the database ,i need to get the value to show preview </script> This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=346801.0 Hello! I'm using the Wyzz editor as part of a web application, allowing users to type in using a Wysiwig editor which will then print on the web page what they type. I'm wondering if there's a function in PHP which can tell if the text is "html" or the wysiwig stuff. In other words, if I'm in the text mode and I click on the bold icon, and I type: Hello how are you? ---- then it prints "Hello how are you." but if it's in the html mode, it and I type: <b>Hello how are you?</b> I'd LIKE it to be smart enough to spit out a bold Hello how are you. Instead, it gives me back <b>Hello how are you?</b>. So, might there be a version of the PHP echo which basically says "Hey, if it looks like an HTML tag let's treat it as such?" As you can see by my code below, I'm just using a PHP echo statement right now: Code: [Select] <script language="JavaScript" type="text/javascript" src="../../js/wyzz.js"></script> <?php if (isset($_POST['insert'])) {echo $_POST['textfield'];} ?> <form action="" method="post"><textarea name="textfield" id="textfield" rows="10" cols="40"></textarea> <script language="javascript1.2"> make_wyzz('textfield'); </script> <input type="submit" name="insert" id="insert" value="Add Text" /> </form> Thank you for taking the time to read this. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=312838.0 Hello i just want to code a function for my editor that help me to do this: i copy a page with some note and picture in my editor,when i press send bottom editor find IMG tag in and upload it in my own server i can write a function for finding IMG tag and upload,but i don't know how i have to add automatic upload to my server,is there any body here can help me for coding this? or do you know one script or editor that have this properties on it? i use my sample editor if any body copy and paste anything from word to editor some unwanted css also coming with that pasting. when we request the data same css also coming with that. so how to clean data when we request $desc =$_request['contents']; how to solve this issue. please help me. I am using CKeditor 3.2. Everything is going fine except image uploader, flash uploader and table... These content are not working.. my site is in PHP.. I have searched too much to solution on Google not found a right answer... infact, there are many results talking about filemanager folder which i was not able to find on downloaded zip. One more thing; when i am uploading images through default uploader and send it to database everything is fine, but when i am retrieving that image on some page; the image is not displaying, /"/" kind of code displaying instead of the images.... What to do to resolve this issue..... Kindly help me its very needed... Thanks in advance.... This topic has been moved to Beta Test Your Stuff!. http://www.phpfreaks.com/forums/index.php?topic=342258.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=333966.0 |