JaCEnt
Members
-
Joined
-
Last visited
Reputation Activity
-
JaCEnt got a reaction from royadyhop in PHP Query MySQL with POST variableEvening all, I have a PHP\MySQL registration script which I'm looking to amend.
Currently you register using your Name, Company Name and Email Address. From there, your username and password are emailed to you.
A problem I have come across is anyone can register as the same company and this would prove troublesome for future use.
What I am looking to do is query the database and if an entry already exists for that company, die;
$company = mysql_real_escape_string($_POST['company']); $query= "SELECT * FROM members WHERE company = '$company'"; $result = mysql_query($query) or die ("Error in query: $query " . mysql_error()); $row = mysql_fetch_array($result); $num_results = mysql_num_rows($result); if ($num_results > 0) { $err[]='Your company is already registered, please contact your admin user!'; } However, that is showing a resource error.
Can anyone shed any light on what I am doing wrong?
-
JaCEnt got a reaction from andy9l in HTML5 Equivalent to PHP includeI've sussed it out using a simple PHP line, should have thought about it more before posting lol I would post the line but it wont let me - a google for "php if current page" brought it up for me.
-
JaCEnt got a reaction from Renaissance-Design in The security certificate presented by this website was issued for a different website's addressHi, I know this thread if a few days old, so I'm sorry for bringing it back up if your problem has already been resolved!
Assuming you're hosting this site on a linux server, you will need to run something like this to generate a new CSR;
openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr
This will generate a new private key "server.key" and a new CSR "server.csr" which you can upload to your SSL provider for them to generate your new cert.
Note this is a 2048 RSA request (recommended), which most SSL certs require now.
I hope this helps!