Will Gresham 81 Master Poster

Instead of putting a password hash in the URL (Not a very good idea) why not generate a random string when the user is created and just put this (and possibly the username) in the URL.

Then, check that the string in the URL matches the one in the database when they visit the page.

Will Gresham 81 Master Poster

Is the '$_SESSION' value set?

Change your query to this:

$result = mysql_query($query,$con)or die("Error: " . mysql_error());

Does it output any errors with that in place?

Will Gresham 81 Master Poster

Take a look at the onmouseup and onchange attributes for the input fields.
Also look at regex (regular expressions) to check the field contents for only numbers.

Will Gresham 81 Master Poster

But I for one don't want factory settings. I want a clean install without the factory add-on software that I'll never use (AOL comes to mind).

Yes!

I got my new Acer a few months back, the first thing I did was put in my Win7 disk, format and clean install.
Then through Audit mode install all the drivers and software I want, update windows(I have done this on my previous PCs, but with Win7 only being out for a couple of months I didn't bother :P) and finally take a disk image.

Didn't even look at what was installed as standard, I booted it to make sure it worked and went from there :D

IMO manufacturers need to stop bundling software onto their PCs and provide a clean version of Windows. I do see where they are coming from with the AV/Firewall pre-installs, but who honestly wants Norton installed on a PC?

Will Gresham 81 Master Poster

Your write function has a name which looks familiar.

Try not to use names of actual JavaScript functions.
What is happening is that you are saying:

onclick="write(document.getElementById('words').getAttribute('value'));" >

Which is doing the same as if you have put:

onclick="document.write(document.getElementById('words').getAttribute('value'));" >

See the problem?

Will Gresham 81 Master Poster
Will Gresham 81 Master Poster

You should be using $result in the mysql_fetch_array() function, not $sql as this expects to receive the result of an SQL query.

Will Gresham 81 Master Poster

What code are you using at the moment and what errors (if any) does it return?

Will Gresham 81 Master Poster

mysql_real_escape_string() will escape data for database entry.

But you don't tell us what you are doing already, show code examples or really give us any idea of what you have done so far, but I assume this will work.

Will Gresham 81 Master Poster

Did you even read the sticky?

Will Gresham 81 Master Poster

I have connected to the IRC a few times, but no-one is ever on when I do :)

Will Gresham 81 Master Poster

The easiest way would be using an API if the owners of the other site have that option.

Otherwise as you said cURL is a good starting point.

Finally, you could try 'Screen Scraping' (again, cURL) to get the source code from a rendered page and pull the information you need.

Will Gresham 81 Master Poster

The first thing I posted was a response to someones question: This post!

My first question was almost a month after joining here, but that never got a response :D

Will Gresham 81 Master Poster

This is not a PHP function. It is likely that you have an included file or code somewhere which defines this.

Will Gresham 81 Master Poster

Nice to see you back :)
Although there is nothing wrong with 'batting for the other team' as someone so eloquently put it...

Will Gresham 81 Master Poster

I use the same password for everything (nearly everything anyway) it contains part of the WPA2 key for my router, part of the phone number at my previous address and part of my name :P

It is not a dictionary word, is 16 characters long has a mix of alphanumeric characters and symbols, so I would like to think it is fairly secure :)

Will Gresham 81 Master Poster

Even with your broken English, the answer it the first result on Google

At least attempt to do your own research :(
PHP

anu.reka85 commented: lol this is not i need +0
Will Gresham 81 Master Poster

Then there is Weird Al

Kinda gone off him, got old very quick for me :P

Listening to Metallica at the moment :)

Will Gresham 81 Master Poster

Plenty of ready made guides already available:
Try Google?

Will Gresham 81 Master Poster

The $_SESSION variable is an array anyway, so no need to declare it as an array.

A few slight errors in your code though, look through the below and comments:

session_start();
      $rand = mt_rand(0, count($files));
      while(in_array($rand,$_SESSION['rand_img'])) {
        $rand = mt_rand(0, count($files));
      }
      // Check if the array has 50 indexes, and remove the first index if it does
      if(count($_SESSION['rand_img']) >= 50) {
        $removed = array_shift($_SESSION['rand_img']);
      }
      // No need for $i, [] will insert the $rand in the next location.
      $_SESSION['rand_img'][] = $rand;
   }

That should work, but I have not tested it, but hopefully you get the general idea..

Will Gresham 81 Master Poster

Agreed, but tell that to GB and all the mideast (Islam) nations.

Yes, I am not very happy with GB, makes me ashamed to be British at times.

As I said, it was IMO and apparently my government does not share my opinion :P

Will Gresham 81 Master Poster

Providing you clean up after yourself with session_destroy(); you shouldn't have too many issues. Sessions are small files :)

Will Gresham 81 Master Poster

Well, these messages are obviously not so secret anymore...

But, IMO promotion of any single religion by any government is not right.

Will Gresham 81 Master Poster

Use a session to store the $rand value for the last x images:

$_SESSION['rand_img'][] = $rand;

You could add in an if to that to remove the first item of the array once 50 items are stored.

Then, use the In array function to see if the rand number generated is in the session and regenerate if it has been seen in the last x times.

Will Gresham 81 Master Poster

The first example you put there is a function, which can include code to execute at a later time, and can be called using the function name. This is useful for something that needs to be done multiple times in a page as you only write the code once.

function my_function(parameter1, parametar2) {
  //Do something here
}

//To call the function
my_function('foo','bar');

The second one is a class (OOP) which typically contains a group of functions. This is used for many things such as a shopping cart in an eCommerce site as the code is reusable and fairly dynamic.

Lastly, generally $_var variables are global ones such as $_POST to get data posted from a form, $_GET to get data from the query string, and $_SERVER to get data related to the server.

Will Gresham 81 Master Poster

Go here: http://www.daniweb.com/forums/profile.php?do=editoptions

Scroll down to the 'Thread Display Options' section and make sure that 'Show Signatures' is checked and save.

As above, I can also see your sig, so its your end :)

Will Gresham 81 Master Poster

That will remove any preceding or trailing white space from the string.

Also, you may want to phrase your initial question better :P You asked for a script to add a space 'after every 4 digits' which is what you got..
\w will match a-z, A-Z, 0-9 and underscores, so yes, replacing the d with a w should work if you want a space inserted after every 4 characters.

Will Gresham 81 Master Poster

You were slightly out, its is since 1/1/1970 :P

Will Gresham 81 Master Poster

I am a student myself (technically.. on a (multiple) gap year).

I have no problem helping people, regardless of what their reason for asking.

However, if I see a post with a few lines of text detailing a vague idea of what they want, I am less likely to want to try to assist compared to a post where the OP has got some description of what they want, their current code and what the problem is.

Basically, if the poster has shown some initiative and done some research themselves, I am happy to help, otherwise they get a nice link to www.lmgtfy.com :P

Will Gresham 81 Master Poster

Good :)

You will need to alter this bit:

$image_ext = explode('.', $image); 
$image_name = date('Ymdhis'). "." . $image_ext[1];

If the user uploads an image with the name 'picture.123.456.jpg' for example, that script will not work.

Do something along the lines of this:

$image_ext = explode('.', $image); 
$actual_ext = count($image_ext) -1; // Get the string after the final period.
$image_name = date('Ymdhis'). "." . $image_ext[$actual_ext];
Will Gresham 81 Master Poster

If you echo $dest what does it say?

Will Gresham 81 Master Poster

hi, I have tried both

$image_name = date('$dest' 'Ymdhis') . "." . $image_ext[1];

//and i have tried this 

$image_name = date('uploaded/' 'Ymdhis') . "." . $image_ext[1];

but i get an error all the time ??

Perhaps you should take another look at the Date function..

Will Gresham 81 Master Poster

Surely you would want to use the value of $dest to store the file location in the DB..

Will Gresham 81 Master Poster

Why are you storing dates as datetime? A timestamp would be better, they are much easier to work with.

Take a look at this:
http://www.dreamincode.net/forums/showtopic19953.htm

Will Gresham 81 Master Poster

So people thought it was just the latest topics

Looks like I was one of those people :D

Either way, the current layout looks good :)

Will Gresham 81 Master Poster

New home page looks good :icon_smile:

Don't know how long it has been there as I have only just seen it... a lot more useful than the previous one which just listed the latest topics.

Nice update :)

Will Gresham 81 Master Poster

Got a mix of Evanescence and Muse on at the moment

Will Gresham 81 Master Poster

Apparently this server has a mind of it's own :P

Allsorts of fun with subscription emails being duplicated and other bits :D

Will Gresham 81 Master Poster

For some reason Daniweb decided to double post that for me :-O

Will Gresham 81 Master Poster

I have posted that a few times, mainly when a search on the exact text they used as the thread title will bring up the answer as the first result.

I tend to think, if they cannot be bothered to search, I cannot be bothered to actually help them.

Will Gresham 81 Master Poster

That I didn't know about :)

I will have a look now to see if it is any good.

I am really getting tired or having FF open for a couple of hours and finding it is eating + of 500MB of RAM.

Will Gresham 81 Master Poster

+1 There are too many posts where a block of code is posted without any real comments or additions info.

How will people learn if the are given all the answers?

Will Gresham 81 Master Poster

Post your code so we can see what is wrong..

Will Gresham 81 Master Poster

I use Ad-Block, NoScript, Greasemonkey, Firebug and some cookie management/editing addon.

When Greasemonkey like support is in Opera I will seriously consider switching :)

Will Gresham 81 Master Poster

Any reason not to use the previous thread you started?

Will Gresham 81 Master Poster

I am liking alot of the features Opera is offering such as these: http://www.opera.com/dragonfly/

But I prefer to have the Addons in FF which make life so much easier :)

Will Gresham 81 Master Poster

Please rephrase the question or post an example of what you are trying to do.

Will Gresham 81 Master Poster

I have totally switched to Mozilla Firefox. I really like the user interface.

And Greasemonkey :D

Best extension ever.

Will Gresham 81 Master Poster

Easiest game ever :P

Even with the nice ending lol.

Completed it in under 5 seconds :D

Will Gresham 81 Master Poster

Yes this is possible.

You will need a server side script to take the name the user wants, queries your database and outputs either yes or no.
You will need to use JavaScript (BTW, Ajax is JavaScript) to send a request to the server side script with the users name and get the response.

Take a look on Google, there are many tutorials and examples already available.