Will Gresham 81 Master Poster

PHP will only be able to calculate the time taken to generate the page before sending it, it would not be able to count in the time taken to download the content etc.

However, at the beginning of your script you could get the current date/time and output this in some JavaScript code as the start time, and then in a JavaScript function get the local system time when the page has finished loading, and work out the total time from there.
Of course, this will depend on the client having the correct time/date and being in the same timezone as the server. So a better method may be to have an Ajax function to get the current time from the server when the page has loaded and use this.

Will Gresham 81 Master Poster

Take a close look at this line:

#
if ($_POST['Alumnos'] empty($_POST['Maestros']) empty($_POST['Admins')])) {
Will Gresham 81 Master Poster

If you are using a BLOB field to store the images (By the way, I would not do this. The filesystem is the best place to store files, not the database, but it's up to you) you will need another script to get the data and output it as an image.

Assuming your images are in jpeg format, then the following should work. This is an example, you will need to change it for your script.

1. Change the image output:
(You will need a new file, I'll call it getimage.php for this, you will also need a unique identifier in your database such as an ID column with an auto increment, I called this $row)

echo "<td>";
echo "<img src=\"getimage.php?image_id=" . $row['id'] . "\" />";
echo "</td>";

2. Then in the getimage.php file (or whatever you named it) you will need another database call to get the row using the ID in the query string, you know how to do a SELECT so I will not detail this.
To make PHP output the image as an image, you need to set the header, then you can echo the result from the db:

header('Content-type: image/jpg');
echo $row['image'];
Will Gresham 81 Master Poster

1. You are using a td element without having a table or tr.
2. You have declared it as a function, and not very well at that, but you have not called the function so it will not do anything.
3. For scalability, it would be better to use a foreach rather than a for to output the columns.

Also, remember to use [code]

[/code] tags around your code, and finally, some text detailing what you have tried and what it is/is not doing would be better than just dumping your code here.

Will Gresham 81 Master Poster

So how are you saving the images?
- Saving images to the server and storing the location in the database
or
- Storing the image as a BLOB type in the database

Will Gresham 81 Master Poster

Your wordpress installation is trying to use a function with the name get_header, but this function does not exist.

Really? how about telling us which WP version you are using and what theme you added. Or better yet, ask on the Wordpress forums (http://en.forums.wordpress.com/).

Will Gresham 81 Master Poster

You don't have any image tags around the echo $row['image']; so it will output plain text.

Will Gresham 81 Master Poster

See the problem with this line?

if($result)
Will Gresham 81 Master Poster

You'll need to use the odbc_connect function in PHP to do this, using the DSN on your access database.

Will Gresham 81 Master Poster

The reason this does not work will be clear when you read the mysql_query page at php.net.

Here is what it says:

Description:
resource msql_query ( string $query [, resource $link_identifier ] )

And then goes on to say:

link_identifier
The mSQL connection. If not specified, the last link opened by msql_connect() is assumed. If no such link is found, the function will try to establish a link as if msql_connect() was called, and use it.

You are using the mysql_select_db value in the query, it is expecting the result from mysql_connect.

To simplify things, if you only make 1 connection to MySQL, then you can omit this parameter altogether.

Will Gresham 81 Master Poster

You will need to have the mysql_connect statement in every script that you wish to connect to the database, this does not transfer between scripts.

Alternatively, have a separate file which connects to the database and then use a require or include statement to use it on any page you need to.

Will Gresham 81 Master Poster

You can try counting the number of values in the table, if this is 0 then there are no entries.

Your mysql_query should contain something similar to this:

SELECT count(*) FROM `table_name`
Will Gresham 81 Master Poster

The function you want is unlink.

Plenty of info on the PHP site. And plenty of tutorials available online if you search for them :)

Will Gresham 81 Master Poster

You are missing part of the tag, your code would output this:

<a href='profile.php?player_id=>'value_from_$row</a>

The > and ' are the wrong way around for starters, and there will be nothing next to the player_id=

Will Gresham 81 Master Poster

I love the 'End' key on my keyboard :)

Will Gresham 81 Master Poster

What's wrong with the answer posted in the thread you stared yesterday?

Will Gresham 81 Master Poster

I'll go ahead and say what you are all (probably) thinking:

Pictures and videos of pretty ladies (and men) in various states of undress and undertaking various activities not suitable for the minors present :)

Or to put it bluntly, porn :P


Edit: almostbob beat me to it...

Will Gresham 81 Master Poster

Make sure all PHP code which deals with sessions, cookies or such is above any output, for example; you have HTML above the PHP code, which will cause the headers to be sent, after which you cannot do session_start();.

Always initiate sessions as the first line of the file (after the PHP tags obviously)

As an additional note, it is not recommended to use plain text passwords, these should be hashed at a minimum before putting them in cookies or sessions, however, you should ideally not include password hashes in any sessions or cookies.

Will Gresham 81 Master Poster

Overall I like it :)

A couple of things though, I apologise if these have been mentioned: 1, The collapsible blocks still use the standard VB icons (I realise these will most likely be changed anyway)

2, There is no page selection at the top of the page, only at the bottom

3, The MFF, is it possible to make it like the other popups that go poof when you click off them?

4, IMO, MFF looks rather shabby with the 'New as of...' bit, I would like the double-click to set as read thingy back as well (Maybe with this new as of thing as alt text?)

5, Buttons. The sponsor button made me feel special :D

6, Edit/Delete button. Shouldn't this only say Edit for non-mod/admin people?

7, Forum listing pages, icons and text are a bit on the large size.

8, Quotes.

Don't like to moan, and I know it may well be tweaked over the next few days/weeks/whatever, but thought I'd put in my $0.02

Will Gresham 81 Master Poster

Look forward to it :)

Will Gresham 81 Master Poster

You cant -1 in a general chat forum =(

Apparently you can.

Although on topic, I don't know of the game you describe.

Will Gresham 81 Master Poster

When IT people make such a song and dance about technical jargon, programming semantics and syntax, it baffles me why they don't apply the same rigour to their spoken medium.

Written, there should be some standards followed and whatnot, but you will never get people speaking the same :P

/pointless post

Will Gresham 81 Master Poster

Soon, 4chan will give out "infractions"
Later--

I have a feeling this guy would have a field day if he ever stumbled upon the 4chan 'community' :D

Will Gresham 81 Master Poster

You might find this of interest

Will Gresham 81 Master Poster

No, you're not blind - I guess I'm just crazy. I thought you had to check a box for it to keep you logged in. I logged out to check that and there is no "Remember Me" check box. Sorry for the misdirection :)

It seems to set the cookie automatically for me. Are you allowing DaniWeb to set cookies?

There is a remember box, when I come to the site and find myself not logged in, I click the 'Join Us' link at the top so I don't have to wait for the JS to load so I can get the login box to popup. There /is/ a remember box on the login form on the registration page :)

Will Gresham 81 Master Poster

http://jquery.com/

download and include in your php file

I would disagree with that, I would always suggest using a CDN one, such as the one on google code (http://code.google.com/apis/ajaxlibs/documentation/#jquery)

This article sums up my reasoning for this quite well.

diafol commented: good advice - nice article +5
Will Gresham 81 Master Poster

Yes, Happy St Georges day to all :)

British and (somewhat) proud :P

@ardav, I assume you are looking for more of this
[img]http://www.willgresham.com/img/flag1.jpg[/img]

and less of this
[img]http://www.willgresham.com/img/flag2.jpg[/img]


:P :D

Will Gresham 81 Master Poster

No idea what ritas is/are so haven't tried it :)

Driving

Will Gresham 81 Master Poster

Personally, I use something along the lines of the following:

$salt = sha1(md5($_POST['password']));
$password = md5($_POST['password'].$salt);

Using strings such as username or user id is not a good idea as these will be known by anyone using the site, but using the password means that it is unique for each user without having to save the sale string anywhere.

Also, providing you salt the password, then MD5 should be fine :)

Will Gresham 81 Master Poster

You will also want to wrap column names in backticks (`) in the case that they are reserved words (for example, your order column) to prevent query problems.

List of reserved words in 5.1: http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html

Will Gresham 81 Master Poster

So do you just want to have the links parsed as plain text, or do you want them removed all together?

Either is possible, just depends on exactly what you want to achieve.

Will Gresham 81 Master Poster

Needs some work :)

I understand it is probably a W.I.P at the moment, I just asked it:
'What is PHP?'

It responded:
'I dont understand u said my code is working and its is displaying as what u wanted then what is your requirement.'

A search on DaniWeb shows that that line is from this thread:
http://www.daniweb.com/forums/thread203560.html#post916989#

:)

Will Gresham 81 Master Poster

Look at the source code for the document in your browser, do the elements have the correct names (the ones you are expecting)?

Will Gresham 81 Master Poster

I'm not convinced on Bing. It seems to be a re skinned Google.

Do identical searches on both and the results are generally the same, maybe a slightly different order but no major differences for a good query.

Why they market it as a 'decision engine' is beyond me, it doesn't appear to do anything new or any neat tricks... Unless I am missing something..

jonsca commented: No, you are exactly right. +0
Will Gresham 81 Master Poster

I was expecting the full animation when that loaded... until I realised it was a jpg not a gif...

Still, +1 to the above sentiment. Spend more money on the essentials :P

Will Gresham 81 Master Poster

I am not for this, in any way.

I do not reside in the US, and I am not a US national, I am English, I live, was born, was educated and work in the UK, so I do not believe that the US has any right to store my personal musings or opinions.

That being said, they do state that the will store public tweets, so if it comes to it I will make my account private.

Will Gresham 81 Master Poster

You have no Select statement so of course you are getting nothing...

Will Gresham 81 Master Poster

Is the directory structure the same for both servers? and are the required files in the same locations?

Will Gresham 81 Master Poster

I thought you were referring to the Board Game from the title :(

But no.

Will Gresham 81 Master Poster
Will Gresham 81 Master Poster

Add the onclick event to the element containing the text.

Will Gresham 81 Master Poster

You will need another table for users, and in that table you will need a column for their permission level.

Then in your PHP script, check the users permission from the DB, and only give them the options they are allowed to use.

Will Gresham 81 Master Poster

Try something like this:

<form>
<input id="foo" type="text" />
</form>
<div id="bar" onclick="populate(this);">
value for the div
</div>

JS:

function populate(el) {
document.getElementById('foo').value= document.getElementById(el.id).firstChild.nodeValue;
}
Will Gresham 81 Master Poster

To set the value of the textbox, use .value, not .innerHTML

Will Gresham 81 Master Poster

Try using like instead of = in the query.

$result = mysql_query("SELECT * FROM `some_table` WHERE `some_column` like '%some_value%'");

I was beaten by the post above :), that suggestion takes into account the commas too.

My suggestion will match anything with that number in, so if $test was 4 then it would also pull 42, 143, 204 etc..

Will Gresham 81 Master Poster

Camtasia Studio 6

Looks like it has quite a few features, but it is rather expensive :-O

Will Gresham 81 Master Poster

In your query, you need to use backticks (`) around column names, not quotes (')

Will Gresham 81 Master Poster

Is the other file saved with a .php extension?

Will Gresham 81 Master Poster

Ah, my mistake. I misread your first post to say it was not putting the data into the table :(

What happens if you create a file called phpinfo.php and put this code into it:

<?php
phpinfo();
?>
Will Gresham 81 Master Poster

What do you see when you look at the page source?