-
-
Advice on postcode radius search?
Hey, I did a project that needed this a couple of years ago. I simply took the postcodes and with the help of google maps converted them to a Lat and Long. I then simply found the distance between these two points. This may help: http://www.zipcodeworld.com/samples/distance.php.html
-
Barcodes and Readers
Hi Guys, Im currently working on a project where I need to generate Barcodes for each product in a catalogue. I have done this without any problems. The idea is that these unique barcodes to be printed off, placed on the products and then shipped to the warehouse. I know that a barcode is simply a unqiue string. Therefor.... My Client has asked if, with the help of a Barcode Reader, the stock count in the databasse of each product could be deducted if the item is scanned. Is this possible? The simplest way is to call a webpage and simply deduct the given code by 1, however I dont know if this possible. Am I approaching this the right way? Can someone with any experience in this field please point me in the right direction. It would help an awful lot. Thanks in Advance, BlackMagic
-
Restricting File Access. HtAccess?
Hi Richard, The problem is that I want my functions to be ableto access the file whilst I dont want users being able to access the file via a URL.
-
Restricting File Access. HtAccess?
Brill. Lots of food for thought! Thanks!
-
-
-
Restricting File Access. HtAccess?
Thanks Snider DK, But how would I go about this? Basically i want to be able to read the file but not the public. I've had an idea that via ht.access I could please a secret key on the text file i.e 1234. So if you visit settings.txt you get redirect as you will need to go to seetings.txt?secret=1234 in order to access. What do you think?
-
Restricting File Access. HtAccess?
Hi Guys, I have built an ecommerce solution however I have a text file that contains "senstivie" informaiton. I need to access the text file in order to read its ocntents, however i dont want people to be bale to just access the file via a URL such as /incs/settings.txt in a web browser. Whats the best way to do this? I know I could do this with htacess by redirecting the url away from the file however, this will then not allow me to read it? Any help would be appreciated.. Thanks In Advance
-
PHP Comments? Correct Style?
Guys, Sorry. I know how to comment. What I need to do is comment correctly for a software application. i need to know what the correct Style for PHP comments are i.e in Java you have @package, @author etc.
-
-
-
PHP Comments? Correct Style?
Hi Guys, I need to comment my methods in my classes but am finding it dificult to find a correct style to follow. If i was writing the application in Java or C# I would know what I was doing. Could anyone put me in the right direction? Thanks in advance
-
MySQL database table row numbers/total rows count
To add a row number create a ID in your database table, Make it primary so it is unqiue and then allow it to auto increment so it will always be unique. To count the the total number of rows, mysql has a built in function called mysql_num_rows. Below is an example: <?php $link = mysql_connect("localhost", "mysql_user", "mysql_password"); mysql_select_db("database", $link); $result = mysql_query("SELECT * FROM table1", $link); $num_rows = mysql_num_rows($result); echo "$num_rows Rows\n"; ?> A full link can be seen here: http://php.net/manual/en/function.mysql-num-rows.php Hope this helps!
- Function returning value
-
Simple move_uploaded_file problem.
Hi Guys, I have a problme with my code and i dont know where. There are no errors being returned for the file im uploading and the directory is 777. Below is the code. Please have a look and put me out of my misery! $allowedExtensions = array("image/gif", "image/jpg", "image/jpeg", "image/png"); if(in_array($_FILES["myImage"]["type"],$allowedExtensions)){ //print_r($_FILES['myImage']); if($_FILES["myImage"]["error"] != 0){ echo "<p class='error'>Error while uploading Image. Please check the file is not corrupt or open.</p>"; }else{ $target_path = "uploads/"; $target_path = $target_path.time()."_". basename( $_FILES['myImage']['name']); if(move_uploaded_file($_FILES['myImage']['tmp_name'], $target_path)) { echo "<p class='success'>Image Uploaded Successfully</p>"; } else { echo "<p class='error'>File was not uploaded.</p>"; } } } else { echo "<p class='error'>The File you have tried to upload is an incorrect file extension. The only files able to be uploaded are gif, jpeg, jpg and png.</p>"; } Thanks In Advance
-
MVC - Should I be using one?
Thanks Guys. Do you suggest I use an existing MVC such as CakePHP Code Ingniter etc or build my own? Regards
-
PHP private chat / live support script
http://www.ajaxdaddy.com/demo-ajax-chat.html Have a look at this. Its very simple and writes the chat window to a text file on your server. You could obviously use a database instead and then password protect the page trying to be accesed.
-
MVC - Should I be using one?
Hi Guys, I am creating a Ecommerce solution from scratch as a personal project as I am tired of using existing solutions due to fact of not be able to add simple methods and functions with out having to go round the houses. I have also documented this from scratch and feel that the best way to build a robust low cohesive solution is to uase a tried and tested design pattern. This is when I came across model-view-controller. i like the idea but I have never coded one before. Is this a good idea? Is there a better design pattern to be using for an ecommerce solution? Any help would be greatly appreciated. Thanks in advance.
-
Free live chat programs
ajaxdaddy.com have a great simple Ajax chatroom - writes to a text file and is really useful.