Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by denno020

  1. When you hit enter whilst entering text in an input field in a form, that form will submit.. The input field needs to be surround by a <form> for this to work. If you don't have <form> tags around your input, then you can use this code that I found from a Google search at stackoverflow: $(document).keypress(function(e) { if(e.which == 13) { alert('You pressed enter!'); } }); And put into practice here: http://jsfiddle.net/Gehtf/1/ Hope that helps Denno
  2. What value is currently being echoed into your input fields?
  3. Simply use an if statement to check if the thumbnailUrl array index is set in your $data variable. If it is, echo the value, otherwise, echo the path to your static image. Denno
  4. First step would be providing a link to your site so we can see the problem for ourselves. What error are you getting when it all fails? Have you included jQuery properly?
  5. Can you show me an example outline of the code that you would like to end up with? In your PHPFiddle, the $content variable already has <p> tags.. I don't quite understand where you want them to be.. If you can show me the outline that you want to achieve, I'm sure I'll be able to help you with your loop. Denno
  6. The & means it's passing a reference to that variable. Without it, the foreach would need to look like this: foreach($test_array as $index => $value) { if ($value['item'] == '2') { $test_array[$index]['qty'] = 5; break; } }
  7. There are a couple of ways you could do it: Save the base price into the DOM somewhere -> in a hidden div or hidden input or Use ajax to query the server for the base price every time the quantity updates Then, when the quantity is changed, multiply the base price by the new quantity, and set the result into the 'total' field.
  8. When a radio button is selected, set a cookie or use local storage to store the value of the radio selected. Then when the page refreshes, check to see if the cookie/local storage variable is set, and then use that to set the radio button value. That would be the theory to get the job done. Denno
  9. The class db() on this line $db = new db($DB_HOST, $DB_USER, $DB_PASSWORD, $DB_NAME); isn't a standard PHP one. You need to include the PHP file that has the definition for that class. Denno
  10. Don't you have to call execute() on $con? I don't know what $con is so I don't know what method you're using..
  11. You need to look into adding a 'Login with Facebook' link to your site (php application). To do this, you will need to create an application on Facebook, which will give you access keys to talk between Facebook and your php application. Then using the Facebook php class, you can interface between a user who clicks on the 'Login with Facebook' and your application, grabbing their basic public information, as well as anything that you have specifically requested when setting permissions for your Facebook application. Hopefully that gets you heading in the right direction. Denno
  12. What code snippets have you tried already? Post some here and tell us where you think they're going wrong, or if they're just completely not working, and I, or someone else, will guide you through why.
  13. I suppose you could store the company names in a text file instead, each name on a new line. Then read in that text file into an array using the php function file(). Then you can loop through the variable that you assigned that to, and include all the files. I think that would work.. $names = file("names.txt"); foreach ($names as $name) { include "../".$name."/rest/of/path"; //Put your correct amount of ../ here }
  14. This would usually be done with a database that would store values like; when the timer was started, if the timer is paused, (and if paused) when the timer was paused. Without the use of a database, I guess you could use a cookie or localstorage to store those same values. When your page loads, look for that information and have the timer set itself accordingly.. Hope that gets you on the right track Denno
  15. $show_path = new FileStorage(); echo $show_path->FileStorage($path); That should work.. Make sure you do it outside the class definition, or inside another function within that class that is called externally. Hopefully that helps Denno
  16. The error is telling you that there is an unknown variable being used, kunder, aka $kunder. If you look on line 16, you will see that you're trying to access $kunder as an array, however $kunder is not initialised anywhere, and therefore, is undefined. Denno
  17. It looks like it's told you already what you need to do.. Without looking at your code, I would assume you're doing something like this: $arr = array( /* lots of data*/); echo json_encode($arr); The error message is asking for the header, so on the line directly before your echo, you need to add header('Content-Type: application/json'); Hope that helps. Denno
  18. Depends on what you mean by 'link them into one variable'. //You can add/subtract/divide/multiply them all, as suggested by kadeous $wholenumber = $number1 + number2 + $number3 + $number4; $wholenumber = $number1 - number2 - $number3 - $number4; $wholenumber = $number1 / number2 / $number3 / $number4; $wholenumber = $number1 * number2 * $number3 * $number4; //You can concatenate them $wholenumber = $number1 . $number2 . $number3 . $number4 //You can put them into an array $wholenumber = array( $number1, $number2, $number3, $number4 ); Those are three very basic things that you could do to 'link' them, which is all we can really suggest without more information as to what you actually want Denno
  19. This is wrong //Writes the information to the database mysql_query("INSERT INTO band (Name,website,Description,timestamp,photo)") VALUES ('$Name', '$website', '$Description', '$timestamp','$photo') ; This is right //Writes the information to the database mysql_query("INSERT INTO band (Name,website,Description,timestamp,photo) VALUES ('$Name', '$website', '$Description', '$timestamp','$photo')") ; You'll notice that you put the double quote and bracket in the wrong place...
  20. I'm not sure if it's just a problem with copying and pasting your code here, but can you see in your PHP, the highlighting isn't working correctly.. That is because you've missed a closing double quote and ending bracket.. Look at your mysql_query(...... line, and find where you're missing the required characters. Denno
  21. I'm curious, what do you use to code in? If you used any sort of IDE, then you would see that you have a syntax error. Using the curly braces around php functions in a string won't work, you need to concatenate the function inside the string. Refer to the fixed code below echo "<tr bgcolor=\"#333333\"><td><p><font face=\"Verdana, Arial, Helvetica, sans-serif\" color=\green\"><b>{$band['Name']} - Review Posted: ".date("F j, Y g:i a", strtotime($band["timestamp"]))."</b></font></tr>"; That should fix your problem. As for there not being an error number, 500 Internal Server Error is an error number.. Denno
  22. Tp print 'address' and 'pubkey', you will access it like this: $apple[0]['address'] $apple[0]['pubkey'] Your variable $apple is an array, with 1 element, which is another array. That array then has all of your values, so that's why you need the '[0]' before the index of the value you want (as array's are 0-indexed, meaning the first value is always at position 0, second value at position 1, and so on). Hopefully that helps you out. Denno Edit: I just read through all of your code (instead of just looking at the print_r result), to avoid the need of the [0], then change: $apple = array ($service->validateaddress("1234567890")); //to $apple = $service->validateaddress("1234567890"); Then you access the values like this: echo $apple['address']; echo $apple['pubkey'];
  23. You need to see what the action of your form is. Easiest way to do that would be to view the source of the page once it's loaded, then debug back from there. Also, in your description you say you want to go to forum.php, however in the first part of the if statement for settings $forumurl, you've got forum.html there. Denno
  24. Php won't return values whilst the script is still executing. Only at the end will any output actually be sent. So your echo will only be echo'ed at the end of the script processing, as per your findings. The way you would do a progress bar (at least the way I think you do it, as I've not actually done it myself), is to also use cURL. Denno
  25. Well from the Twitter images, it looks like you want the semi-transparent background? Opaque means you can't see through it, so either I'm confused as to what you want, or you're confused on the meaning. Anyway, if you want the partially transparent background, then a very simple way to do it would be to give the div a background colour of white using the rgba setting: #div { background-color: rgba(255, 255, 255, 0.5); } The 0.5 means it's 50% transparent. That will allow some of the background to show through, while still allowing the text to be read fairly easily, however you will have to play with the values to find the right balance. Hope that helps, Denno
  • 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.