Search Results

Showing results 1 to 40 of 93
Search took 0.01 seconds.
Search: Posts Made By: humbug
Forum: PHP Aug 20th, 2009
Replies: 7
Views: 646
Posted By humbug
If you want to update the page without reloading it you will have to use client side scripts such as Javascript. (PHP is a server side language and so all the php is executed before the page is sent...
Forum: PHP Jul 23rd, 2009
Replies: 4
Views: 221
Posted By humbug
I'm assuming it's just a bad tut because of the lack of attention to detail and testing. The @ symbol was never for variables.
Forum: PHP Jul 22nd, 2009
Replies: 4
Views: 221
Posted By humbug
It seems there is an error in the tutorial you are using. the "@" symbol is actually used to suppress an error that the following function might throw: http://www.tuxradar.com/practicalphp/19/8/12
...
Forum: PHP Jul 22nd, 2009
Replies: 2
Views: 195
Posted By humbug
I'm not that familiar with streaming video but I'm quite sure that if you want the browser to show something, you must tell it where it is. The browser then determines what to do with it, so it can...
Forum: PHP Jul 22nd, 2009
Replies: 20
Views: 1,127
Posted By humbug
For each user you want to check, you would do something like this:
1. Get the timestamp for this user from the database
SELECT last_activity FROM user_activity WHERE id=$id
2. Compare this...
Forum: PHP Jul 21st, 2009
Replies: 20
Views: 1,127
Posted By humbug
Sorry for not getting back to you about my idea. What I meant was, you store the timestamp for each user's last activity in the database. Then any time you want to check if someone is "active" you...
Forum: PHP Jul 21st, 2009
Replies: 10
Views: 476
Posted By humbug
Don't worry CFROG, I still do it. You skim over your code and remember what you should be there instead of reading what is there. Another set of eye's can spot it in no time. :P
Forum: PHP Jul 19th, 2009
Replies: 10
Views: 476
Posted By humbug
Holy Moley, you'll hate your self for this :P You forgot a crucial line: mysql_query($sql); which should go on line 16. As your code stands, it doesn't execute the new SQL command, just sets the $sql...
Forum: PHP Jul 19th, 2009
Replies: 20
Views: 1,127
Posted By humbug
The easiest way to do this would be to set a column "lastactivity" to the current time every time the user loads any of your pages (just build it into your authentication script). You can then...
Forum: PHP Jun 27th, 2009
Replies: 2
Views: 330
Posted By humbug
The problem you are having is with your double quotes.

echo "value of the constant CONSTANT: " . CONSTANT;

notice the text in blue, this is a string. You are trying to put double quotes inside...
Forum: Database Design Jun 7th, 2009
Replies: 1
Views: 961
Posted By humbug
You can use a for loop to operate on each element of the array. I'm assuming it's a one (meaningful) columned table.

//len is length of array
for (i=0; 0<len; i++){
//create SQL statement
...
Forum: PHP May 9th, 2009
Replies: 3
Views: 569
Posted By humbug
Might also be a good idea to do

if (!mysql_query($sql)){
die (mysql_error());
}
Forum: PHP May 7th, 2009
Replies: 3
Views: 569
Posted By humbug
Your form should look like this:

<form ...>
<input type="hidden" name="student" value="$row['student']" />
<input type="submit" name="delete" value="Delete" />
</form>


Then you can get...
Forum: PHP May 5th, 2009
Replies: 6
Views: 854
Posted By humbug
You could even use an "INSERT ... ON DUPLICATE KEY UPDATE ..." query (if you have a primary key "id" column) but that's getting complicated.
Forum: PHP May 5th, 2009
Replies: 6
Views: 854
Posted By humbug
I am not going to write your code for you - that's the sort of thing I get paid for :P - but I will help you do it yourself.

The way I would do it is as follows:
You will need

A place to...
Forum: Linux Servers and Apache Apr 8th, 2009
Replies: 0
Views: 596
Posted By humbug
Having hardly used macs in my life, I am now borrowing an old iMac 3G (OS 10.2.8 I think) to temporarily host some php files. I have downloaded the latest version of MAMP to get the job done and done...
Forum: PHP Apr 4th, 2009
Replies: 2
Views: 271
Posted By humbug
You need to post the relevant code for anyone to know what's going on. Is the code that checks the input data and the code that displays the input boxes on the same page? Does refreshing/reloading...
Forum: PHP Mar 18th, 2009
Replies: 1
Views: 240
Posted By humbug
How is your database set up? That will only work if
1. postid is unique to each post and parentid holds the id of the parent post and NULL if it is itself a parent post.
OR
2. parentid is set to...
Forum: PHP Mar 18th, 2009
Replies: 7
Views: 396
Posted By humbug
a variable (such as $myusername) must be set in the same script for it to have a value, and thus be echo'd to the page. This means the value will be lost if the user refreshes the or follows a link. ...
Forum: PHP Feb 17th, 2009
Replies: 9
Views: 3,723
Posted By humbug
Sorry, way to long ago to remember or find out.
Forum: PHP Jan 15th, 2009
Replies: 3
Views: 397
Posted By humbug
Hmm, you've got an input for the quantity. Did you add that in the hope of getting it to work? Does the cart work how it is without quantity? What do you actually mean by "add the amount of items in...
Forum: PHP Jan 14th, 2009
Replies: 3
Views: 397
Posted By humbug
Are you using a session to store the stuff in the cart or what? I'd suggest creating a session for the user with the following variables:

array $quantity
array $product

each element of those...
Forum: PHP Jan 14th, 2009
Replies: 2
Views: 567
Posted By humbug
Using any program that can use sockets you can do this. If you have php installed on your computer then that's easy. I have done it with Game Maker (using 39dll) before.

What you need to do is...
Forum: PHP Jan 14th, 2009
Replies: 8
Views: 477
Posted By humbug
There are functions for including in a script, a script held in another file. Is this what you mean? i.e. you can define the functions that you will use (and constants, variables, etc) and then...
Forum: PHP Jan 14th, 2009
Replies: 3
Views: 582
Posted By humbug
Ok, you need to look at a few tutorials (there's millions on the net) about user logins and sessions. In a nutshell:

form.html This contains the textbox.

<form action="submit.php" method="GET">...
Forum: PHP Jan 14th, 2009
Replies: 3
Views: 388
Posted By humbug
See here (http://www.daniweb.com/forums/thread167986.html).
Forum: PHP Jan 13th, 2009
Replies: 6
Views: 854
Posted By humbug
Assuming you have all the data stored in a MySQL table you sould need something like this:

<?php
//login to MySQL db

$result=mysql_query("SELECT * FROM user_settings WHERE...
Forum: PHP Jan 11th, 2009
Replies: 6
Views: 771
Posted By humbug
As PHP is a server side language, PHP can't be used to modify the page once it has been sent to the browser. You need a client side language (that is executed by the viewers browser) such as...
Forum: PHP Jan 10th, 2009
Replies: 2
Views: 672
Posted By humbug
To have less of an impact on the server at runtime I'm guessing 2) would be much better as in 1) you must load the entire history of news items into memory as opposed to about 30 bytes per news item....
Forum: PHP Jan 9th, 2009
Replies: 5
Views: 567
Posted By humbug
@bappaditya
Are you saying "www1" is to www1.example.com as "mail" is to mail.google.com? Does this mean that "www" a subdomain but many modern web servers are able to assume a subdomain of "www"...
Forum: PHP Jan 9th, 2009
Replies: 2
Views: 793
Posted By humbug
first, after $find_ad has been set, I would split the data by $list = explode("</tr>",$find_ad) then do a replacement on each item like so:

$list=preg_replace("/([^>])(</a> \(\d{4}\))/",'\1\2 - <a...
Forum: PHP Jan 8th, 2009
Replies: 9
Views: 3,723
Posted By humbug
Thanks for that last bit of info, it has actually made my requests successful. You've been a big help because HTTP headers is something I have only briefly read over.

Cheers.
Forum: PHP Jan 2nd, 2009
Replies: 9
Views: 3,723
Posted By humbug
Notice how line 24 of my code includes "GET" and not "POST"? That's the call I used to (successfully) send a GET request (as the English above clearly states).

I have slightly modified the code...
Forum: PHP Jan 1st, 2009
Replies: 9
Views: 3,723
Posted By humbug
Here's my predicament. I Have managed to send and retrieve some HTTP requests using the GET method successfully using the following code:

function...
Forum: PHP Dec 23rd, 2008
Replies: 4
Views: 1,151
Posted By humbug
Ok, first off I'd direct my form to a page of my own, say "submit.php", which would store the data passed to it into the database and then (before echoing any data to the page) use header() to...
Forum: HTML and CSS Dec 14th, 2008
Replies: 7
Views: 2,322
Posted By humbug
I have made those changes but no luck.

here's (http://alterego.freewebhostingpro.com/signup.php) the site. Hit view source to get everything you need (there's no external linking).

I'm baffled....
Forum: PHP Nov 7th, 2008
Replies: 2
Views: 383
Posted By humbug
What exactly are you asking for? What is a word "we like"? It will probably be possible to write a function to do what you want but I'm not entirely sure what that is.

All in all, what info do you...
Forum: PHP Nov 6th, 2008
Replies: 13
Views: 1,909
Posted By humbug
In php, if you try to perform an operation on $start_time (assuming that it is a variable in the script containing a string) it will be used as an integer. It works fine if the string is something...
Forum: PHP Nov 2nd, 2008
Replies: 7
Views: 555
Posted By humbug
Is it throwing any errors? Is it echoing anything at all? Make sure the values that are sent to the page via POST are the correct values to use in the mysql table. Note that the 'if $sercounty ==...
Forum: PHP Nov 2nd, 2008
Replies: 10
Views: 873
Posted By humbug
If you don't want to get into the CRON stuff then I would suggest that instead of having tables for inbos and outbox, you could have two more columns in the "message" table, one called "in_inbox" and...
Showing results 1 to 40 of 93

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC