Forum: PHP 11 Days Ago |
| Replies: 4 Views: 205 Exactly, like I said. You would have one file say image.php generate the image and in the file you wanted to show the image you'd do
<img src="image.php?someparam=somevalue" /> |
Forum: PHP 11 Days Ago |
| Replies: 4 Views: 205 If you want to place it dynamically inside another page you would have one PHP file generate the image and then point to that in an <img> tag.
But to set the content-type just use:... |
Forum: PHP 11 Days Ago |
| Replies: 15 Views: 371 What he said, it's been a long day :) |
Forum: PHP 11 Days Ago |
| Replies: 15 Views: 371 Remove [] from the name of the field, PHP sees that and tries to turn it into an array. |
Forum: PHP 12 Days Ago |
| Replies: 2 Views: 195 time BETWEEN '$endDateTime' AND '$startDateTime' Put quotes around the dates |
Forum: PHP 16 Days Ago |
| Replies: 3 Views: 219 Your first place you should go for any question related to PHP is the PHP documentation: http://php.net/for |
Forum: PHP Oct 22nd, 2009 |
| Replies: 2 Views: 201 What do you mean by calling the table? Also, why're you using PDO for the connection then just completely ignoring it and using mysql_query anyway? http://php.net/pdo |
Forum: PHP Oct 20th, 2009 |
| Replies: 6 Views: 271 If you see absolutely nothing then you may be getting an error. On the line before $source = ... put ini_set('display_errors', 'On'); error_reporting(E_ALL); If you're getting an error that will show... |
Forum: PHP Oct 20th, 2009 |
| Replies: 6 Views: 271 If the file is on the same server as the script then use the absolute path. If it's a remote file use the URL. |
Forum: PHP Oct 20th, 2009 |
| Replies: 6 Views: 271 You're not giving a full path, you're giving a web path. In the first example it is making a web request to fetch the file, in the second example it is directly accessing the filesystem. Make sure... |
Forum: PHP Oct 20th, 2009 |
| Replies: 7 Views: 240 If you want to save simulations for future use just use a damn database. Don't try to go against the grain when working with PHP. There are plenty of tools as your disposal for working with stuff... |
Forum: PHP Oct 20th, 2009 |
| Replies: 7 Views: 240 You can't, use a database. It's that simple. |
Forum: PHP Oct 19th, 2009 |
| Replies: 4 Views: 205 As for this, if you're just using it as a learning experience then it should be just that. It's not a very good learning experience if you just follow someone else's tutorial. The point of recreating... |
Forum: PHP Oct 19th, 2009 |
| Replies: 4 Views: 205 If you're trying to get the value of $id in that string then you have to concatenate because you're using single quotes.
echo '<a href="profile.php?id=' . $id . '">Enzo's Profile</a>'; |
Forum: PHP Oct 14th, 2009 |
| Replies: 14 Views: 322 Now do the same thing, type php -v and paste the output here. If it says something like
PHP 5.2.6 (cli) (built: sometime)
Copyright (c) 1997-2009 The PHP Group
Zend Engine blah blah
Then you have... |
Forum: PHP Oct 14th, 2009 |
| Replies: 14 Views: 322 oh, hahaha, did you also do sudo apt-get install php5-cli? |
Forum: PHP Oct 14th, 2009 |
| Replies: 14 Views: 322 type php -v on the command line and paste the output here. |
Forum: PHP Oct 14th, 2009 |
| Replies: 14 Views: 322 type ls /usr/local/bin and if php isn't in that list then reinstall it. |
Forum: PHP Oct 14th, 2009 |
| Replies: 14 Views: 322 It's #!/usr/bin/env php and if that doesn't work then you didn't install php correctly. If you're using ubuntu or any debian distro it is just sudo apt-get install php5. |
Forum: PHP Oct 14th, 2009 |
| Replies: 14 Views: 322 This will find the php interpreter for you and use it, don't directly link to it.
#!/usr/bin/env php |
Forum: PHP Oct 14th, 2009 |
| Replies: 7 Views: 379 That won't actually get you the value of the hiddenName element though. You would have to do document.getElementById('submittedName').value. But since you're not really setting the value anyway you... |
Forum: PHP Oct 13th, 2009 |
| Replies: 2 Views: 210 |
Forum: PHP Oct 13th, 2009 |
| Replies: 5 Views: 290 If you get no errors and no exception is through but it's still a white page that means the query returned no results. Execute the query directly in MySQL or phpmyadmin or whatever you're using to... |
Forum: PHP Oct 13th, 2009 |
| Replies: 7 Views: 379 Holy crap no. Just no. A thousand times no. |
Forum: PHP Oct 12th, 2009 |
| Replies: 7 Views: 379 <script type="text/javascript">
function submitForm(val)
{
document.getElementById('submitted').value = val;
document.getElementById('submitted').form.submit();
}
</script>
<form... |
Forum: PHP Oct 7th, 2009 |
| Replies: 4 Views: 235 http://php.net/preg_match That is all |
Forum: PHP Oct 6th, 2009 |
| Replies: 15 Views: 507 What's the error? (also, your code doesn't have an ending brace for the outer if) |
Forum: PHP Oct 6th, 2009 |
| Replies: 15 Views: 507 Your query might be failing
$result = mysql_query($sql);
Try
$result = mysql_query($sql);
if (!$result)
{
echo mysql_error(); |
Forum: PHP Oct 5th, 2009 |
| Replies: 4 Views: 331 Line 49
if ($_POST["$submit"])
// should be
if (isset($_POST['submit'])) |
Forum: PHP Sep 29th, 2009 |
| Replies: 4 Views: 257 The server it is working on probably has notices turned off. You should have an if (isset($_POST['username'])) block around that anyway. |
Forum: PHP Sep 25th, 2009 |
| Replies: 8 Views: 283 heh, you can't exactly test load balancing with a ping and I can say without a doubt that if you DoS a hosting company to "test their load balancing" they'll be very quick to send a nicely formatted... |
Forum: PHP Sep 24th, 2009 |
| Replies: 3 Views: 387 Show us your current code, we don't know you database schema or what to change if you don't |
Forum: PHP Sep 17th, 2009 |
| Replies: 4 Views: 922 Explode on spaces and use ORs for the extra terms. http://php.net/explode |
Forum: PHP Sep 10th, 2009 |
| Replies: 3 Views: 294 <?php
// create short variable names
$searchtype=$_POST['searchtype'];
$searchterm=trim($_POST['searchterm']);
if (!$searchtype || !$searchterm) {
echo 'You have not entered search details.';... |
Forum: PHP Sep 3rd, 2009 |
| Replies: 2 Views: 363 Well you have an unclosed/broken tag here on line 62 that may be causing issues
<div <!--Div class added by Damion -->
Aside from that grab firebug(http://getfirebug.com) for firefox and toy... |
Forum: PHP Sep 3rd, 2009 |
| Replies: 2 Views: 292 Is there some absolutely halting reason that the joomla stuff can't be hosted on the same server? It's not like its that hard to port a database and rsync code |
Forum: PHP Sep 2nd, 2009 |
| Replies: 2 Views: 438 Don't try to mix creating your own json strings
$objJSON = array('sample' => null);
// whatever
$objJSON['sample'] = $arr;
$objJSON = json_encode($objJSON);
echo '<script... |
Forum: PHP Aug 21st, 2009 |
| Replies: 3 Views: 262 The problem is that get_browser returns an array, not an object. use $b['parent'], not $b->parent |
Forum: PHP Aug 14th, 2009 |
| Replies: 12 Views: 1,155 Your example should work the way you want it. There is no dimensioning of arrays in PHP, space is allocated as necessary. |
Forum: PHP Aug 13th, 2009 |
| Replies: 2 Views: 206 You use . to concatenate so echo ucwords($_SESSION['fname'] . ' ' . $_SESSION['lname']); |