RichardRotterdam
Members-
Posts
1,509 -
Joined
-
Last visited
Everything posted by RichardRotterdam
-
try the jQuery attribute selector This should prob work: username = $("input:[name='username']").val(); password = $("input:[name='password']").val(); fname = $("input:[name='fname']").val();
-
[SOLVED] Actionscript Help: auto populating array random
RichardRotterdam replied to chmpdog's topic in Other
Why don't you store all the playable frames inside an array and shuffle it? That way you can simple increase the array key by one each time you enter a new game thus not having to check if you already played the game. -
Looking for a simpleXML walk through
RichardRotterdam replied to woodsonoversoul's topic in PHP Coding Help
A database within a database ??? That does not sound right at all. How did the xml get in the database in the first place? Do you have the option to parse the xml before you insert it into the database? That way you can simply use a query which will output information that's directly usable. -
[SOLVED] Problem with Easy javascript code
RichardRotterdam replied to luxeon's topic in Javascript Help
Your code is fine it's just a typo you made in your script tag you wrote text/javasript instead of text/javascript change : <script type="text/javasript" src="script.js"> to: <script type="text/javascript" src="script.js"> -
[SOLVED] Problem with Easy javascript code
RichardRotterdam replied to luxeon's topic in Javascript Help
What's not working about it and does the script.js contain the js code: window.onload = writeM; function writeM() { document.getElementById("text").innerHTML = "hello"; } -
As far as I've heared these SL mmorpg games do use external servers to store information for player status. Using PHP, ruby python or what ever serverside language doesn't really matter as long as you can use a database to store information. This is how I think you could accomplish what you are trying to achieve. You can sort of use an ajax approach (read articles about what that is). Only instead of if using javascript you'll be using LSL (Linden Scripting Language). Not sure if it is possible but chances are prob pretty high. So to create this SL mmorpg game you'll need to learn the following things. 1. any programming lanuage that can run on a webserver (such as php) 2. SQL 3. LSL
-
I think you're mixing up a lot of stuff here. Xampp is a bundle installation of apache, mysql ,php and perl. It isn't one program. Having trouble with xampp means you might have trouble with apache, mysql ,php or perl. To see if that is the case try to run a regular php or perl script (depending on what you are using for ajax). See if that causes any trouble, if not then it simply isn't xampp. Ajax is not just one thing is a combining javascript with a serverside language. For the javascript part check if your browser gives any js errors and also try a different browser to see if your problem is browser related. Read up on ajax to understand your problem better. And also post your code you're using (only the relevant code)
-
Do note that you need to pass the complete url (path + name) of the image location to the function. Just the name of the image is not enough. What is the location of the image? and have you tried to echo out the path and the image name to see if it is correct? echo WEB_ROOT . 'images/' . $row['thumbnail']; if that is the correct path try: if (file_exists (WEB_ROOT . 'images/' . $row['thumbnail'])) { You might also want tocheck if the slashes are included I notice you forgot them throughout your code on several places.
-
It does make more sense now since you posted more of the code. How ever it is messy though and has vulnerabilities. What I see is that you're basically are trying to put 2 pages in 1 which are: [*]a page with all records listed [*]a detail page(showing only details of one record) Is this correct? But anyway looking back at the previous code which is just a lot of bullocks (and which I am sorry to say I suggested due to being either too tired to see it or just too early without having a proper cup of coffee thrown down my throat) file_exists($id["thumbnail"]); That was no good since the $id var wasn't an array to start with. it should be: file_exists($thumbnail); or use the row instead file_exists($row["thumbnail"]);
-
Well to start it says EXPERIMENTAL in caps and red so somehow using that for a customer product doesn't sound like that good of an idea. Something else I read is the following That makes me think that it simply doesn't support the $_SERVER var since it prob wasn't intended for writting scripts on a webserver. I think you're better using something else for protecting your source
-
Do you mean this thing on the following url ??? http://us3.php.net/manual/en/intro.bcompiler.php
-
basicly that second example is jsonp (json with padding). I do think you need access to the server for the script that gives the json response since it's a bit different. The following example I found using google http://a.webvm.net/ you can even see the php source which makes the jsonp possible. If you don't have access to the server you want to use that will output a response, then you're better off using cURL or just any serverside script that can read remote data. With a script like that you could make a remote ajax call a local ajax call.
-
Why not ditch the list function? You're making it more complicated for yourself then you really need. remove list($id, $title, $date, $news_description, $thumbnail) = $row; The $row var is an array in your loop, you can see the thumbnail value like so(if the fieldname is thumbnail that is): <?php while($row = mysql_fetch_array( $result )) { // in case your fieldname for your thumbnail is indeed thumbnail. echo $row['thumbnail']; } ?> you can check what values are stored in the $row array like so: <?php while($row = mysql_fetch_array( $result )) { echo "<pre>",print_r($row),"</pre>"; } ?> And what does your query look like and what are the field names you wish to use? Can you post the complete code including the sql query?
-
Since you are trying to access a method within the same object change the following to see if it makes a difference: didin_action.getGuard(); to this.getGuard(); and also if it is jQuery and fac1 is an id you might want to change $('fact1').value; to $('#fact1').value;
-
use cURL or file_get_contents to read the remote xml
-
convert sql server database to mysql
RichardRotterdam replied to arlabbafi's topic in PHP Coding Help
what is that ? :-\ http://dev.mysql.com/doc/migration-toolkit/en/mysql-migration-toolkit-introduction.html -
It doesn't work that way. In your case PHP is serverside(on a webserver) and javascript runs clientside(within your browser). If you want to see how your javascript looks like use the "view source" option in your browser. It should be like this btw <?php $tester = $_POST['test']; ?> <script type="text/javascript> var helloworld = "<?php echo $tester; ?>"; document.write(helloworld); </script>
-
[SOLVED] jQuery: Adding event to dymanically added element
RichardRotterdam replied to GingerRobot's topic in Javascript Help
All you needed is the live() function read the comments for explanation <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> <script type="text/javascript" src="http://jquery.com/src/jquery-latest.js"></script> <script type="text/javascript" > jQuery(document).ready(function(){ // add listener to text input elements (even new created ones using live()) $("#theform input[type=text]").live('keyup',function(){ // fetch all the text input elements var inputElements=$("#theform input[type=text]"); // boolean to see if all elements have values var allElementsFilled=true; jQuery.each(inputElements, function() { console.log(this.value); if(this.value==""){ allElementsFilled=false; } }); // count the amount of input elements var elementCount=inputElements.length; // add a new text input when all are filled if(allElementsFilled){ $("#theform").append("<div id =\"container[]\">Input "+elementCount+": <input type=\"text\" name=\"input[]\" /></div>"); } }); }); </script> </head> <body> <form id="theform"> <div id ="container[]">Input 1: <input type="text" name="input[]"/></div> <div id ="container[]">Input 2: <input type="text" name="input[]"/></div> <div id ="container[]">Input 3: <input type="text" name="input[]"/></div> </form> </body> </html> -
Wanna start my own Blog, using PHP.. help required.
RichardRotterdam replied to Maven000's topic in PHP Coding Help
I'd would say don't do that. First start out by deviding your blog app in smaller chunks.. It will be easier to build your blog when you have a good understanding what it exactly is that you are going to build. Start programming after that. I think a database would be better then using a text file. You'll find tons of tutorials on how to use PHP in combination with MySQL. You don't have to use MySQL though. Here are some other db options: Sqlite(a flat file database) Postgresql MSSQL You could use a txt file but I don't recommend that. Not sure what you mean with that. I wouldn't really worry about SEO at first. As you mentioned you just want to learn PHP. just have fun building your blog. With the word "tags" what do you mean? Do you mean tagclouds? or do you mean that you want to edit your text as you were editing a document using word or something similar? If you want to edit your blog like that I suggest you use google and search RTE(Rich Text Editor)? Or do you mean something completely different? -
[SOLVED] Applying a time limit to edit posts
RichardRotterdam replied to runnerjp's topic in PHP Coding Help
You could simply store a timestamp/datetime when a new post insert has been done and then compare that to the time the form page gets loaded. -
You may also want to show where this gallery script runs http://www.russwilliamsart.com/gallery.php When I open that page in IE I receive the following error: "this property or method is not supported for this object" on line 248 this is what I see on line 248 description = this.getDescription(); searching through the Gallery class the function "getDescription()" is nowhere to be found. I suggest you comment that line out and see what that does since you can't use what isn't there.
-
PHP already has excellent xml parsers you don't really need a custom function. Try this <?php // parse the xml (change the path to suit your needs) $xml=simplexml_load_file("inventory.xml"); // loop through each unit foreach($xml->Unit as $unit){ // get unit attributes $attriubtes=$unit->attributes(); echo "<b>rec_id:</b> {$attriubtes['rec_id']} <br />"; // loop through unit options foreach($unit->Option as $option){ echo "<b>option_code:</b> {$option->option_code} <br />"; echo "<b>option_desc:</b> {$option->option_desc} <br />"; echo "<b>option_qty:</b> {$option->option_qty} <br />"; } echo "<hr />"; }
-
With the following: I meant: file_exists($id["thumbnail"]); Another thing, in the following code: $content .= "<li><b><a href=\"news.php?id=$id\">$title</a> <br>$date</b><br> $news_description<br> if (file_exists$id[$thumbnail]; echo '<img src=\"images/$thumbnail\">' <br> <br></li></b>\r\n"; notice how everything is highlighted in red? It makes it more clear that all of it gets crammed as a string in the variable $content. Your if statement and file_exist should not be inside a string. End the string after $news_description<br> like so: $content .= "<li><b><a href=\"news.php?id=$id\">$title</a> <br>$date</b><br> $news_description<br>";
-
<?php if (file_exists$row[thumbnail]) { <img src=\"$thumbnail\">; } else { echo ""; } ?> there is a lot wrong with that code 1. file_exists is a function you have to use () and not directly paste value you want to check behind it. 2. $row[thumbnail] is an array only you are not using quotes you can only leave the quotes when the array keys are whole numbers 0,1,2,3,4, etc. write it like so: <?php $row['thumbnail']; //or double quotes $row["thumbnail"]; ?> 3. <img src=\"$thumbnail\">; either close the php tags or echo your html between quotes. you cant mix html and php like that