Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. Its not an uncommon case. I run a hosted CMS service that has over 1100 clients all hosted within there own virtual host, all using the same CMS core, there own databases and there own configurations. Its quite easy if your application is itself built on a well designed framework. You just need to split the core code and the client specific code apart.
  2. I don't see any call to session_start.
  3. php can write to files so, yes. You can create crontabs.
  4. The first thing I noticed is that this class has html mixed all through it making it tied to a particular site. Classes are meant to be reusable, this is far from it.
  5. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=313079.0
  6. See http://www.phpfreaks.com/forums/index.php/topic,58799.0.html
  7. I think ignace covered it pretty well with... Do you not understand something in particular?
  8. This topic has been moved to Installation in Windows. http://www.phpfreaks.com/forums/index.php?topic=313072.0
  9. Whats steps did you take to install php? What server are you using?
  10. Store each played track within a database along with a timestamp indicating when it was played. Then execute a query that gets the top 10 (or whatever) sorted by timestamp.
  11. trq

    If or?

    if ($item == 1 || $item == 11 || $item == 121) {
  12. Doctrine has its own command line interface, take a look at the help for... doctrine generate-models-db
  13. Don't bother actually redirecting, just set a default. You really need to check your query results before using them too. if (isset($_GET['id'])) { $id = mysql_real_escape_string($_GET['id']); } else { $id = 1; } if ($result = mysql_query("SELECT * FROM pages WHERE id='$id' ",$connect)) { if (mysql_num_rows($result)) { while ($row = mysql_fetch_assoc($result)) { echo $row['anything1']; echo $row['anything2']; } } }
  14. Now I'm with you. You need to rewrite another script (almost a copy of getFtpImage.php) that sets the content type to video/x-ms-wmv (you could use the same script with an if statement that determines the types by file extension. From there, you just use the normal embed method. I have to say, wmv files are not a particularly 'web friendly' format.
  15. This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=313048.0
  16. It is the ternary operator and is basically a short version of if else. if (empty($_GET['id'])) { $_GET['id'] = 0; } else { $_GET['id'] = $_GET['id']; }
  17. If you use an <input> type instead you can easily make it act the same and it could be an image type.
  18. So what is your question? You can't play movies directly within html (yet). You need a player.
  19. There's probably not much to say accept that you obviously need to learn php before you start projects, especially something like what your describing. Once you know the language you can simply design and then develop your application over time.
  20. I always return json objects, especially when there are multiple results. There just VERY easy to work with. So, your jQuery might be something like..... $.ajax({ url: 'query.php', data: {id:10}, datatype: json success: function(results) { if (results.msg == 'success') { for (var i in data) { $('#content').append( 'id = ' + results.data[i].id + ', description = ' + results.data[i].description + ', msrp = ' + results.data[i].msrp ); } } else { $('#content').append(results.msg); } } }); And your php.... if (isset($_GET['id'])) { $sql = "SELECT id, description, msrp FROM tbl WHERE id = '{$_GET['id']}'"; $return = array(); if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { $return['msg'] = 'success'; while ($row = mysql_fetch_assoc($result)) { $return['data'][] = $row; } } else { $return['msg'] = 'No results found'; } else { $return['msg'] = 'Query failed'; } header("Content-type: application/json"); echo json_encode($result); }
  21. This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=313049.0
  22. Your question doesn't make a great deal of sense with the example you have provided. Maybe.... $sql = "SELECT SUM(table_value) as tv_sum"; if ($result = mysql_query($sql)) { $row = mysql_fetch_assoc($result); echo $row['tv_sum']; } helps?
  23. Assuming your array is $arr. foreach ($arr as $k => $v) { $arr[$k] = 'Go' . $v; }
×
×
  • 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.