trq
Staff Alumni-
Posts
30,999 -
Joined
-
Last visited
-
Days Won
26
Everything posted by trq
-
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.
-
I don't see any call to session_start.
-
php can write to files so, yes. You can create crontabs.
-
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.
-
This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=313079.0
-
See http://www.phpfreaks.com/forums/index.php/topic,58799.0.html
-
This topic has been moved to Installation in Windows. http://www.phpfreaks.com/forums/index.php?topic=313072.0
-
Whats steps did you take to install php? What server are you using?
-
how to stream video via ftp folder not accessable to public
trq replied to jasonc's topic in PHP Coding Help
As I said. You need a player. -
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.
-
if ($item == 1 || $item == 11 || $item == 121) {
-
Doctrine has its own command line interface, take a look at the help for... doctrine generate-models-db
-
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']; } } }
-
how to stream video via ftp folder not accessable to public
trq replied to jasonc's topic in PHP Coding Help
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. -
This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=313048.0
-
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']; }
-
If you use an <input> type instead you can easily make it act the same and it could be an image type.
-
how to stream video via ftp folder not accessable to public
trq replied to jasonc's topic in PHP Coding Help
So what is your question? You can't play movies directly within html (yet). You need a player. -
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.
-
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); }
-
This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=313049.0
-
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?
-
How would ANYONE append to every value within an array?
trq replied to soma56's topic in PHP Coding Help
The code I posted does do that. -
How would ANYONE append to every value within an array?
trq replied to soma56's topic in PHP Coding Help
Assuming your array is $arr. foreach ($arr as $k => $v) { $arr[$k] = 'Go' . $v; }