having trouble with a simple text editor

Having trouble with this php code, can’t edit pages its greyed out and can’t press submit… im sure its a simple fix please help!!

<?php header("Cache-Control: no-cache, must-revalidate"); include 'domain.php'; echo ""; echo "
"; $pid=$_GET['pid']; $pid=str_replace(" ", "-", $pid); $d=$_GET['d']; $mn=$_GET['mn']; $afolder = "pages"; if ($d=="a"){ $afolder="articles"; } $pt = "ego.asp"; $pit = "Preview News Letter"; // $pce = "pages/empty.htm"; $tp = "News Letter"; $nid = $_COOKIE['nid']; $srid = $_COOKIE['srid']; if ($srid!=""){ $xml= simplexml_load_file($sitexmlpath . 'reps.xml'); $mypath = "//eid[@u='" . $srid . "']"; $myId = $xml->xpath($mypath); $myt = (string)$myId[0]['t']; $myn = (string)$myId[0]['n']; $mym = (string)$myId[0]['m']; if ($myt=="a") $smt = " [ registered administrator ]"; if ($myt=="r") $smt = " [ registered sales rep ]"; if ($myt=="w") $smt = " [ registered work from home ]"; if ($srid!=$nid && $myt!="") $smt .= " [ client management mode - exit logout ]"; } if ($myt=="a") { if ($pid!="") { if ($mn=="on") $amn = "nl-"; $itemfilename = $afolder . "/" . $amn . $pid . ".htm"; if (file_exists($itemfilename)) { $pce= $itemfilename; } $nowediting = "editing:
" .$amn . $pid; $pt = "submiteditor.php"; $pit = "Save Page"; $tp = "Page Editor [ back - admin ] *nb copy and paste ONLY from notepad - NOT word etc.."; $styles=""; } ?>
<?php echo $tp; ?>

  Style Normal Heading 1 Heading 2 Heading 3 Heading 4 Heading 5 Address Formatted Definition Term Font Arial Arial Black Arial Narrow Comic Sans MS Courier New System Tahoma Times New Roman Verdana Wingdings Size 1 2 3 4 5 6 7 8 10 12 14
Insert Link <?php echo $nowediting; ?>
 CutCopyPasteUndo BoldItalicsUnderlineStrike-throughSuperscriptSubscript Justify LeftCenterJustify Right Ordered ListUnordered ListIncrease IndentDecrease Indent Insert Horizontal RuleForecolorInsert Table  
Edit HTML

 

<?php } else { echo "Please Login"; } ?>

I think we need more context here. You provided some code, but asked about an editor.

If I was to guess without much information to go on, I’d ask if you were opening “read only”, on a file that you didn’t have write access to.

Tables with inline styling…egads. :o

An something tells me that this wouldn’t be a simple solution.

Tables with inline styling rather than using other methods such as classes and id’s are so the way forward… makes it so code efficient and so easy to read :slight_smile: :smiley:

aside from the code resembling a car crash, the submit buttons works just fine on my system.
Tested in both Chrome and Firefox.

Edit: When i say it works just fine, what i meant was the button works, i can press it.
However, upon pressing it your troubles begin:

ReferenceError: SubmitContent is not defined ...ylesheet' href='csshome.css' TYPE='text/css' media='screen'><div style='padding:...

Happy hunting!
Red :wink:

Sponsor our Newsletter | Privacy Policy | Terms of Service