Jump to content

Ninjakreborn

Members
  • Posts

    3,922
  • Joined

  • Last visited

Everything posted by Ninjakreborn

  1. For some reason, the trim isn't working. It removes the ones at the beginning, but leaves the ones at the end alone, I am confused here. Any advice is appreciated?
  2. I am going to try that, but can you help me understand "why" it's doing that. The problem I am having is, I have the form, I already did a test. It's not originally coming from the form the first time. It's not coming from me using the stiptags, or mysql_real_escape_string It has something to do with the form but it doesn't always happen, I will try trim, hopefully it will work, but Ihope someone can tell me what is causing it for future problems like this in the future.
  3. I am very confused then. Here is the text for the editor. [code <script language="JavaScript" type="text/javascript"> <!-- //build new richTextEditor var rte1 = new richTextEditor('description'); <?php $content = rteSafe($_SESSION['temp']['description']); ?> rte1.html = '<?php echo $content; ?>'; rte1.toggleSrc = false; rte1.build(); //--> </script> See that's the original text, then it get's passed to another page, which this is done on it. <?php $allowedtags = "<br>, <ul>, <li>, <ol>, <b>, <strong>, <u>"; $_SESSION['temp']['description'] = strip_tags($_SESSION['temp']['description'], $allowedtags); $_SESSION['temp']['description'] = mysql_real_escape_string($_SESSION['temp']['description']); ?> That is all that is done to that variable. Description is also the only variable it's happening to, it has to have something to do with it? Maybe not any advice on what could be causing this, I never encountered this problem before.
  4. Yes, everything else works perfectly. The quotes, single quotes work. Extra characters aren't messed with. It's only that it adds that damn It seems to throw those rnrn here and there, is there a way I can remove that atleast. It handles everything else graciously, except for that one things.
  5. Can you tell what part of that is adding a /r/n/r/n at the end of the description everytime it's passed through that. Or is it not that funciton that is doing it, that is the only thing I am 'unfamiliar with', mostly because I never used chr. Where do you think it's causing that to happen.
  6. I am sitting here with something called RTE It has a function <?php function rteSafe($strText) { //returns safe code for preloading in the RTE $tmpString = $strText; //convert all types of single quotes $tmpString = str_replace(chr(145), chr(39), $tmpString); $tmpString = str_replace(chr(146), chr(39), $tmpString); $tmpString = str_replace("'", "&#39;", $tmpString); //convert all types of double quotes $tmpString = str_replace(chr(147), chr(34), $tmpString); $tmpString = str_replace(chr(148), chr(34), $tmpString); // $tmpString = str_replace("\"", "\"", $tmpString); //replace carriage returns & line feeds $tmpString = str_replace(chr(10), " ", $tmpString); $tmpString = str_replace(chr(13), " ", $tmpString); return $tmpString; } ?> This is ok, it cleans the content before putting it "back" into the editor. The problem I am having is that, they submit the form, it goes to another page, then comes back if they had errors, it cleans before loading content. But it adds /n/r/n/r at the end of the description,e very single time. I am doing my own server side cleaning. I run it through strip tags with which ones I want to allow, as well as mysql real escape string, but this thing cuts it up before i have a change. Does anyone know of the "opposite" function I can run in the backend, to basically undo all the changes the above function made?
  7. The heart of a true gamer. The ability to appreciate games for what they can be. A lifestyle as opposed to a hobby.
  8. How do you change the background color of an element with javascript document.getElementById(target).style from there, how would I alter/change/remove the background color as needed?
  9. i didn't know that was possible, thanks for telling me that I can keep that in mind later if I ever need to create a mail server. I didn't know it was possible, I have a site I am going to build I will eventually want people to have there own email address, it's good to keep that in mind. Sorry for feeding you the wrong advice initially.
  10. I think mail "servers" have to be done in powerful languages like C#, C++, Perl and other said languages. I know you can build an internal "messaging" system where people can message each other through the same system (I have done that). However sending actual emails to-from the address. You can send emails from it, just setup the mail script for each one, however the only problem is, there is no way "that I know of" someone can email you, and it appear within your database, of having recieved emial. I am not 100% sure about that?
  11. I need to get access to something specific. I downloaded and installed FCKeditor and the client looked at it and had 2 complaints. 1. In order to paste word documents straight you get a message asking if you want to clean it, if you use the tool it comes up in a popup, you must paste it, then it puts it in the text. 2. The spellchecker didn't "fully" work (when I tested it worked, but someone it didn't work for him). The spellcheck is "ESpell", which only works through internet explorer. Well he asked me "if possible" to fix these problems. I have looked at tinyMCE but it seems it will have the same problems. What do I need to do from here, any advice ,or anything. I just need the formatting capabilities, I need the pasting from word, and a spellchecker that's server side if at all possiblke. If I had to, I could install tinyMCE and use the server side PSpell to setup the spellchecking, however that wouldn't solve my problem with the word document pasting. Any advice is appreciated?
  12. Ah ok, I had to use inline for my purpose. I am not use to working with styles in Javascript, thanks. it's very rare I ever have to change styles with it.
  13. Ok, then how do you make it re-appear. That will make it disappear, how do you make it re-appear.
  14. Perfect, I deleted that and started with radio buttons hten. last question, how do you hide text when a radio button is selected. If this needs to be moved, go for it.
  15. Is there an easy way to make a select form only be able to select 1 field. For instance. 3 select boxes, but only 1 of them can be selected at a time.
  16. It ends up getting used in everything day/day programming. For a basic example, here is something off one of my projects, with the same idea. <?php // get user information based on stored session $selectuser = "SELECT * FROM userinformation"; $queryuser = mysql_query($selectuser); echo "<p>Below is all the information about current Clients.</p>"; echo "<hr />"; while ($rowuser = mysql_fetch_array($queryuser)) { // if record found display there user information for editing ?> <?php // display admins here echo "<b>Id:</b> " . stripslashes($rowuser['id']); $edit = "<a href=\"editexistingclient.php?id={$rowuser[id]}\" title=\"Edit This Client\">Edit</a>"; $delete = "<a href=\"deleteclient.php?id={$rowuser[id]}\" title=\"Delete This Client\">Delete</a>"; $addproof = "<a href=\"addproof.php?id={$rowuser[id]}\" title=\"Add Proof\">Add Proof</a>"; $vieworeditproof = "<a href=\"vieworeditproof.php?id={$rowuser[id]}\" title=\"View or Edit Proof\">View or Edit Proof</a>"; echo "<br />"; echo "<b>Email:</b> " . stripslashes($rowuser['email']); echo "<br />"; echo "<b>Username:</b> " . stripslashes($rowuser['username']); echo "<br />"; echo $edit . " - " . $delete; echo "<br />"; echo "<br />"; echo $addproof; echo " - "; echo $vieworeditproof; echo "<hr />"; ?> <?php } ?> That pretty much pulls the list of clients, you see the id's getting passed to the various pages. On those pages things happen with the data. Like for adding a proof (vice versa. on the page you simply $id = $_GET['id']; clean it first however. And there is your id, from there it's basic query knowledge and you can work up your queries, and do whatever you want with it.
  17. That'll work too, I didn't know about that.
  18. I don't remember how, but with javascript you can disable form elements. I just don't remember exactly how to disable them. Ah here it is http://www.codetoad.com/javascript/enable_disable_form_element.asp Something like that, if not google "Disable form elements with javascript"
  19. Here is an example of what I use. These are tested, I reuse and remodify the same initial script I created a long time ago, it always serves my purpose everytime with a little modification. <?php if ($_GET['rownumberprev']) { $rownumber = mysql_real_escape_string($_GET['rownumberprev']); }elseif ($_GET['rownumbernext']) { $rownumber = mysql_real_escape_string($_GET['rownumbernext']); }else { $rownumber = 0; } $limit = 20; $selectall = "SELECT * FROM safetyreport ORDER BY dateoccured DESC;"; $queryall = mysql_query($selectall); $total_rows = mysql_num_rows($queryall); $select = "SELECT * FROM safetyreport ORDER BY dateoccured DESC LIMIT $rownumber, $limit;"; $query = mysql_query($select); echo "<hr />"; echo "<br />"; echo "<table align=\"center\">"; while ($row = mysql_fetch_array($query)) { echo "<tr>"; echo "<td>"; $datefilledout = date("m/d/Y", $row['dateoccured']); echo $datefilledout; echo " - "; echo "</td>"; echo "<td>"; if ($row['confidential'] == "no") { echo stripslashes($row['name']) . " - "; }elseif ($row['confidential'] == "yes") { echo "Masked" . " - "; } echo "</td>"; echo "<td>"; echo "<a href=\"viewallsafetyinfo.php?id={$row[id]}\" title=\"View All Information\">View</a>"; echo " "; echo "<a href=\"editsafety.php?id={$row[id]}\" title=\"Edit Event\"> Edit</a>"; echo " "; echo "<a href=\"deletesafety.php?id={$row[id]}\" title=\"Delete\">Delete</a>"; echo "</td>"; echo "</tr>"; echo "<tr><td><hr /></td><td><hr /></td><td><hr /></td></tr>"; } echo "</table>"; if ($rownumber != 0) { $rownumberprev = $rownumber - $limit; echo "<a href=\"viewsafety.php?rownumberprev={$rownumberprev}\">Previous Page</a>"; echo "<br />"; } if ($rownumber <= ($total_rows - $limit)) { $rownumbernext = $rownumber + $limit; echo "<a href=\"viewsafety.php?rownumbernext={$rownumbernext}\">Next Page</a>"; } ?>
  20. That is more difficult. Simply have forms go from page to page. Page 1 => page 2 (validate page 1, then show page 2 if it's clear) => page 3 (validate page 2, show page 3 if it's clean) => page 4 (validate page 3, do database or whatever other work) Pretty simple when you get use to it. You can pass them all using hidden form fields. Your best bet, is on each page to register a session, then with a little work you can have it where at the end they can have a review form to go back to any section of the form to make corrections without disturbing the data, or the other parts of the form.
  21. It's called a get query. You have to call a database, you use the id to formulate a query to another page that contains the database information.
  22. No, it's for development sites. I work on a site, I go back and forth. I go into my editor, edit css, save it, upload it, refresh browser. Same on a local machine. Edit it in editor, save it, refresh. I like what firefox has in the web developer, instant changes to changed CSS. I am just looking for the same thing but for IE as well, so I can do the same changes to IE as needed.
  23. I have firebug but thought it was useless. I will give it another go and give it a try. Do you know anything as well for internet explorer, that would also be very, very helpful.
  24. Ok, I appreciate it thank you. I checked my updates, I was somehow behind like 2-3 mini-versions it seemed. When I updated I saw the position element there, thanks that was just what I needed. Now I can play around with it, you know of any for internet explorer. The on-the-fly css editing is awesome, I hope they eventually get those capabilities for internet explorer, but the one they currently have for it, sucks.
  25. I have been trying to post stuff in the right areas, this one I have no idea where to post. There is an extension for firefox, called developers toolkit. A really powerful one that gives you control over all aspects of the pages. Can I set it so when you go to Css => edit CSS to where it come's up in another window, a mini pop-up window I can move around or something. Currently it comes up on the left side, but it makes the page smaller, as well as makes the css itself smaller, so it's hard to use that for on-the-fly editing. Thanks?
×
×
  • 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.