Will Gresham 81 Master Poster

First problem with your script, you are missing a ; on line 24.
Second problem, you haven't created a var called xtra which you try to use on line 31.

Also, why are you mixing DOM standard with innerHTML?

Lastly, this appears to be JavaScript, not PHP. For future reference, there is a JS forum here: Click.

Will Gresham 81 Master Poster

Not all browsers have Tabs, so forcing your link to open in a tab is not a good idea, if it is even possible.

Your best option would be to use target=_blank as you already do, this is the closest you will get.

AFAIK _blank will open a new tab in most tabbed browsers by default, but will open a new window in non tabbed browsers.

Will Gresham 81 Master Poster
01011001 01101111 01110101 00100000 01101011 01101110 01101111 01110111 00100000 01111001 01101111 01110101 00100000 01100001 01110010 01100101 00100000 01100001 00100000 01100111 01100101 01100101 01101011 00100000 01110111 01101000 01100101 01101110 00100000 01111001 01101111 01110101 00100000 01100001 01110010 01100101 00100000 01101001 01101110 01110100 01100101 01110010 01100101 01110011 01110100 01100101 01100100 00100000 01101001 01101110 00100000 01101011 01101110 01101111 01110111 01101001 01101110 01100111 00100000 01110111 01101000 01100001 01110100 00100000 01110100 01101000 01101001 01110011 00100000 01110011 01100001 01111001 01110011 00101110

I was interested, so I guess I am a geek too :D

Will Gresham 81 Master Poster

Other than checking that the variables are what you expect (for example, a email address is an email address) there is not much else.

Also, remember to mysql_real_escape_string() all vars before the query.

Will Gresham 81 Master Poster

No need for both checks in that function.
empty() will return true if the value is null so change:

if(($variable==NULL ||(empty ($variable))))

to

if(empty ($variable))
Will Gresham 81 Master Poster

I would use JavaScript to check the form has been filled correctly before being submitted, but you should also validate with PHP as some people may have JS turned off.

The advantage of using JS, means that the user doesn't have to reload the page to be told that the form is incorrect. You can tell the user it is missing something before they click the submit button.

Will Gresham 81 Master Poster

Take a look at line 6, you are missing a ; which is the reason for that error.

Will Gresham 81 Master Poster

Why not have 1 file with the PHP script to make the links, then use an include() function on each of the pages.

Will Gresham 81 Master Poster
Will Gresham 81 Master Poster

Salted hash should be fine for md5 - as long as salt isn't a common word. The sites offering reversal of md5's are often 'dictionaries' or rainbow sites that have a huge db of words - they don't tend to work very well with gibberish passwords. They also tend to focus on English words.

I've heard that double hashing can be useful:

$salt = '5\/p3r<@(1fr@81(15t1<3+p1@(1d0c0\/5'; //supercalifragilisticexpialidocious
$hash = md5(md5($salt . $pass));

Yes, my main point was MD5 is not very good on its own :D

Alot of people probably use dictionary words/names/dates for passwords.

There is no way to actually reverse an MD5, so these sites just have a huge number of hashes and a string that will generate the hash, not necessarily the actual password though.

Will Gresham 81 Master Poster

For your last point, I'd think most CIOs/CTOs would be less worried about costs going up and more worried about no longer "owning" their data. When the data is in the hands of a third party and that third party goes belly up, and has an immediate shut down of services, how long will it be until you have access to the data that was being hosted there? It's a scary thought to not have the info your company needs to run.

This is my main hesitance for embracing the 'cloud'.
Out of sight, out of mind. How many people will honestly back up their data when it is not on their own PC (how many non tech people actually do so at the moment?)

I can see it would lead to alot more problems than it solves.

Will Gresham 81 Master Poster

An id of 11 is more than adequate.

The longest encryption strings I've sees in use is 48 chars.
I don't think you need even that much!
It depends on how paranoid you are about hackers.
Unless you are doing this for the DOD m, bank or NSA, where they are willing to put a lot of effort into the task, any reasonable MD5 encryption should be fine.

I wouldn't use MD5 any longer, there are a multitude of sites online where you can enter an MD5 hash and it will return a valid string within seconds.
Easiest solution would be to salt the string first:

<?php
$string = 'something';
$salt = '*~s#(';
$hash = md5($string.$salt);
?>

It will still generate the nice 32 char hash, but will be harder to reverse :)

OFC, MD5 on its own is good enough for a personal site, but not much else. If you are allowing other people to sign up i.e a community site, you want something a bit more, well more.

Will Gresham 81 Master Poster

No tech, but I did get a couple of books on PHP, the Zend study guide and a PHP OOP book :)

Will Gresham 81 Master Poster

Or you could just click the 'Help' link at the bottom of every FB page and search for removing friends....

http://www.facebook.com/help/#/help.php?page=770

Will Gresham 81 Master Poster

When I come to DW I have the C++ forum bookmarked. So the first thing I do is look at the threads in that forum to see if I need to reply to any of them (via the New button). Then I'd use the Favorite Forums links to do the same with the other favorite forums. In the 4+ years that I have been a member here I think I may have visited the DW Home page 5 or fewer times.

Practically the same for me, but for the PHP forum.

Also +1 to Sknakes point, I look at the HTML and CSS & Site Layout often, and that is 2 layers.. not a huge difference in the amount of time to get there, but it was so much easier when they were always on the right.

I also rarely view the homepage, had to go look just now to actually remember what is on there (I can see why it is useful, but personally I have no use for a list of topics from all forums), I almost always enter the site from a bookmark to PHP or Geeks Lounge, if not then its from history.

Will Gresham 81 Master Poster

I cannot see a call to the mail_it function in the code you posted, but what you will need to do is change the $recipient value that is being sent to the mail_it function depending on which option is selected.

cguan_77 commented: thank you :) +0
Will Gresham 81 Master Poster

There are many scripts available free that offer what you are looking for.

Search before you post

Will Gresham 81 Master Poster

Do you have a link to an example of what you want to achieve? Your description is very vague.

Even better, post the code you already have as well as a link.

Will Gresham 81 Master Poster

Favourite movie of all time is a toss up between Back To The Future and LOTR (Return of the King)

Will Gresham 81 Master Poster

Have to wonder why this guy bothers coming back :D

Will Gresham 81 Master Poster

When referencing vars, you do not need a second $ :

$this->$servername = $server;

Would become

$this->servername = $server;

@tmash
The whole idea of Object Orientated programming is to make your code portable, not every server will have MySQL on localhost so defining this absolutely is not a good idea. The server address is passed to the script when the function is called.

Will Gresham 81 Master Poster

If it uses MySQL, then in all probibility you can do what you want to.

However, I have not used this before and have not seen the source code, without this I cannot suggest what to modify.

Have you tried contacting the company you bought this from to see if they provide this functionality as an addon?

Will Gresham 81 Master Poster

Post up the code you are using at the moment for specific information/help.

It is likely that the database queries are wrong, probably the script is looking for columns you do not have if you are using an example script.

Will Gresham 81 Master Poster
ggeoff commented: Useful advice +0
Will Gresham 81 Master Poster

You need to replace 'your_username' and 'your_password' with the username and password for the MySQL database.

Will Gresham 81 Master Poster

Take a look at the GD library: http://www.libgd.org/Main_Page

Will Gresham 81 Master Poster

1. Please use [code]

[/code] tags to post your code.
2. Tell us what the problem is, I for one would not want to read your code and then guess at the problem.

Will Gresham 81 Master Poster

Post up the actual code you are using at the moment.

Will Gresham 81 Master Poster

The Oasis Of The Sea is 5 times larger than the Titanic and 3 times larger than QE2.

:-O That is a huge ship!

Will Gresham 81 Master Poster

Why not use the RAND function of MySQL?

$query = "SELECT * FROM tbl_admin WHERE id=5 ORDER BY RAND();

Also, if you only want one image at a time, you should add LIMIT 1 to the end of the query.

kvprajapati commented: Great! +6
Will Gresham 81 Master Poster

Use array_pop to remove the last index from the array:

$liArray = explode("</li>", $string);
// $liArray_pop will contain the last index of $liArray, $liArray will be missing the final index
$liArray_pop = array_pop($liArray);
Will Gresham 81 Master Poster

You can specify BCC addresses in the mail function, but that way would not allow you to send personalised emails..

As far as I am aware, mail would be the best way to do this.

Will Gresham 81 Master Poster

Rather funny :D Pointless, but funny...

Will Gresham 81 Master Poster

Haha, no I didn't notice that, but now you pint it out I do :)

Will Gresham 81 Master Poster
<?=$delay?>

look at this place and similar ones
what i can say (maybe I am not experienced in such things), but if you say this is php, then I think it is quite a bad code here. I think

That is an acceptable way to echo a variable within HTML code,

The problem is this line (Line 61):

<td><input type=text name=site value="<?=get_setting("site") size="20"?>" size=30></td></tr>

size="20" is within the PHP braces.

Will Gresham 81 Master Poster

An explode would be the quickest/easiest way to do this.

$liArray = explode("</li>", $string);

foreach($liArray as $key => $value) {
  // $value will contain the li string, do something with it here. 
}
Will Gresham 81 Master Poster

I am still without Windows 7 on my PC...

Only just got an email from the upgrade people saying the CD was shipped today... almost 2 weeks after the release and it has only just shipped :(

Will Gresham 81 Master Poster

Please use code tags, it makes it easier to read your code.

Also, the code on the first page has a Delete statement, the code above does not. Which code are you using at the moment?

Will Gresham 81 Master Poster

It has been fairly slow.

No doubt it is being looked into though :)

Will Gresham 81 Master Poster

yes, its cool too, but the process by ajax will be done in the backend.
page won't refresh while sending the mail.

Reread the first post and the title.

The OP wants a mailto link, not a PHP mail() function.

Will Gresham 81 Master Poster
Will Gresham 81 Master Poster

Do you mean delete in an SQL query, or a unlink to delete files?

Will Gresham 81 Master Poster

The database is not what matters here.

You will either need to make new scripts for the Admin and check within them if the user should have access (By querying the database for the users permissions) or add the code to the existing pages, and then check within them if the user should have access to the admin functions.

You also say that you are an ASP rookie... You are aware this is the PHP forum?

Will Gresham 81 Master Poster

Surely pagination without a limit would not be pagination...

The limit is there to specify how many results are retreived, without it all records would be pulled on each query.

Will Gresham 81 Master Poster
session_start();

if ($_SESSION["user_type"]) {
	Echo " i am a admin ";
}

All that will do is check if $_SESSION has been assigned a value..

If there are more user levels added in the future, this could possibly allow any logged in user to access the admin page. Assign a value to the session var and then check for that value.

Will Gresham 81 Master Poster

Hm, the online users seems to be back now for thread views :)

Really is useful!

Will Gresham 81 Master Poster

:O thats my only computer.. it does what i need it to do. And it only cost me $500 which was all i had when i was shopping for computers.

Each to their own ;)

I prefer having a large screen so I can see my code without squinting :D

Although the price on them is tempting... My PC cost me £600, and the screen a further £100, so slight difference there. I think I would make my eyesight worse by using such a small screen, and it isn't good now :(

Will Gresham 81 Master Poster

I noticed that recently too :)

Saved me typing another 4 characters each time :D

Will Gresham 81 Master Poster

Good to see you are on top of things :)

Will Gresham 81 Master Poster

As Atli says, Blowfish is an encryption cipher, not a hashing algorithm.
It is in the mcrypt library (http://php.net/manual/en/book.mcrypt.php)

There was a whole thread a while back discussing passwords and some good methods. I'll see if I can find it...

EDIT:
Thread is here:
http://www.daniweb.com/forums/showthread.php?t=178241

samarudge commented: Good link, fast reply, quite helpful =D +2