RichardRotterdam
Members-
Posts
1,509 -
Joined
-
Last visited
Everything posted by RichardRotterdam
-
the description on wikipedia is pretty clear on whats the point of it http://en.wikipedia.org/wiki/JSON if its still unclear just ask
-
here is your answer to your problem. you should use css to set the width of your box You have a security leak there even if you're the only one using it you should use mysql_real_escape_string() to prevent sql injections if there is no /r/n stored in the database that function you had wouldn't do anything for you to begin with a rich text editor is something like you see here when you post a message. it will make you enter text like msword does or any office app. tinymce and fckeditor are two examples of rich text editors.
-
You might be able to use the greasemonkey plugin for this however. It's adviseable to just fix your desktop environment(at least I think it's that)
-
a couple of questions. 1. how are you entering the content into the database? 2. how does the content look in the database if you use phpmyadmin or mysql querybrowser or what ever you use to view your database data? 3. does the data in your database fields contain the characters \r\n? 4. have you concidered using a RTE(Rich Text Editor) for content input in your backend? 5, what do you mean with:
-
can you show the code you have so far. While error messages are very helpful to determine what is causing the problem people here can't solve the problem with just the error.
-
why would you define a function in a loop that makes no sence. what does it do when you just echo the content? $query = mysql_query("SELECT * FROM max WHERE id='1'"); while($row = mysql_fetch_array($query)) { $content = $row['content']; echo $content."<br />"; }
-
thats what image tags are for <img src="<?php echo $yourImageUrl ?>" />
-
you can use explode to put the entries in an array $var1 = "43 56 88 02 66 21"; $arr=explode(" ",$var1);
-
[SOLVED] Strange issue with functions?
RichardRotterdam replied to Solarpitch's topic in PHP Coding Help
If that is the code that makes the script crash on some sort of way then it must be the database/database.php script ther is nothing wrong with the function -
How and where to insert a JS script into a PHP page?
RichardRotterdam replied to jacksonH's topic in PHP Coding Help
I don't think anyone is going to read all of that. other then that this is a javascript thing and not php. but anyway if you look at the page where you got the script from http://www.dynamicdrive.com/dynamicindex6/dhtmlcount.htm i see the following description new cdtime("ID_of_DIV_container", "target_date") 1. ID_of_DIV_container (string): The ID of the DIV or span that will display the count down. It is not what the position of the script should be but what you replace ID_of_DIV_container with -
Here is a good link about using tables for layout http://www.shouldiusetablesforlayout.com
-
the link rhodesa gave is most likely the tidier way however if you really want the jQuery way here is a link for the jQuery cookie plugin http://plugins.jquery.com/project/cookie
-
I had that same error once it had to do something with an incorrect libmysql.dll on IIS. If it's your local development computer you can fix it. If its on a hosted server contact the hosting company
-
Youre looking for a RTE (Rich Text Editor) try looking that up
-
smarty is written in php 4 syntax so that means function Smarty(){ } is the constructor. If a class is all php 4 syntax it's tidier to keep it php 4 and not put php 5 syntax in it you're putting in two constructors.
-
Youre trying to edit Smarty.class.php. The Smarty class is fine as it is you can change the value like so. //instantiate object $smarty=new Smarty(); //change the value $smarty->template_dir="what_ever_you_want"; I recommend not changing this class unless you know what youre doing. Instead read how to use the smarty template engine.
-
you missed a double quote in the form after rows somewhere dunno where but its in this html code This is your function combined with mine and its done html <form action="save_comments.php" method="post" onsubmit="return formCheck(this);"> <center><h3>Comments</h3> <br> <textarea name="comments" cols="60" rows="4"></textarea> <br><br> <h3>Suggestions</h3> <br> <textarea name="suggestions" cols="60" rows="4"></textarea> <br><br></center> <input type="submit" value="Save Comments"> </form> js <script language="JavaScript"> <!-- var submitClicked=false; window.onbeforeunload = function () { if(!submitClicked){ return "Have you clicked the 'Save Comments' button. If you haven't, your comments will not be saved."; } } function formCheck(formobj){ // Enter name of mandatory fields var fieldRequired = Array("comments", "suggestions"); // Enter field description to appear in the dialog box var fieldDescription = Array("Comments", "Suggestions"); // dialog message var alertMsg = "Please complete the following fields:\n"; var l_Msg = alertMsg.length; for (var i = 0; i < fieldRequired.length; i++){ var obj = formobj.elements[fieldRequired[i]]; if (obj){ switch(obj.type){ case "select-one": if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){ alertMsg += " - " + fieldDescription[i] + "\n"; } break; case "select-multiple": if (obj.selectedIndex == -1){ alertMsg += " - " + fieldDescription[i] + "\n"; } break; case "text": case "textarea": if (obj.value == "" || obj.value == null){ alertMsg += " - " + fieldDescription[i] + "\n"; } break; default: } if (obj.type == undefined){ var blnchecked = false; for (var j = 0; j < obj.length; j++){ if (obj[j].checked){ blnchecked = true; } } if (!blnchecked){ alertMsg += " - " + fieldDescription[i] + "\n"; } } } } if (alertMsg.length == l_Msg){ submitClicked=true; return true; }else{ alert(alertMsg); submitClicked=false; return false; } } // --> </script>
-
try sourceforge.net
-
using two forms is probably not the best way but here is the js solution js <script type="text/javascript"> var submitClicked=false; function submitForm(){ submitClicked=true; } window.onbeforeunload = function () { if(!submitClicked){ return "Have you clicked the 'Save Comments' button. If you haven't, your comments will not be saved."; } } </script> html(you just need the submit button) <form action="somepage"> <input onclick="submitForm()" type="submit" id="submit" name="submit" /> </form>
-
you can use a break in any loop foreach($somearray as $value){ if($something){ break; } }
-
Hi, you can use the month() and year() functions in mysql example SELECT date_field from message where month(date_field)=11 and year(date_field)=2008
-
how to disable browser close (x) button
RichardRotterdam replied to andros_k's topic in Javascript Help
you can't do that and I am glad that is impossible think of all the annoying stuff people would do with that ability. And even if there was a way there is always alt+f4. You will have to find another solution to your problem. What could help is use a modal instead of a popup -
actually there are more ways such as placing an event listener. This is one i prefer because you dont have to browse through all the html to find what link has what function. when javascript is disabled nothing will happen and when javascript is disabled now it will go to a_link.html
-
Look for javascript context menu scripts here is one in prototype http://yura.thinkweb2.com/scripting/contextMenu/
-
what it says is that you have can replace the $() of all jquery calls to the jQuery() function can you show a bit of code on your page i'll give an example with that