Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

adamsmith

Members
  • Joined

  • Last visited

Everything posted by adamsmith

  1. The site that I am currently working on is competely ajax based, whenever a new address is called such as domain.com/#something it only loads the new information into a div, rather than reloading the whole page, only that div reloads. If I have an SSL Certificate on domain.com will this secure my whole site and it's various ajax calls, such as the login script and the shopping cart? Or does it not work like this? I'm not too sure. Thanks
  2. How is developing a program using Javascript and LUA done? I know this is a vague question and what I'm trying to get at is that in the web domain, Javascript is used inside HTML, not as a standalone language. Can a program be created using just JS and LUA or will there need to be another program/language that contains the JS and LUA code or would the files simply be saved as .js/.lua and be able to run? I know that another language is used to style the program, but ignoring that I need to know how a program can be written using these two languages and if there are any tutorials I can look at, everything I find for JS is all web related.
  3. I think it might be a problem with the user that Apache is running on, how can I test this, I've tried echo'ing exec('whoami') but it shows nothing
  4. D4Y0 - These are the file permissions it gives back 0644 OwnerArray( [name] => daemon [passwd] => * [uid] => 1 [gid] => 1 [gecos] => System Services [dir] => /var/root [shell] => /usr/bin/false)GroupArray( [name] => wheel [passwd] => * [members] => Array ( [0] => root ) [gid] => 0) Jack - That's a good idea, I have removed all the default settings and taken the size limit out, but maybe could still have something to do with it...
  5. I created a script to upload audio files to my site, it all worked perfectly, then I decided to use the jQuery file upload plugin http://blueimp.github.io/jQuery-File-Upload/ It uploads the audio fine to the directory I want it to but the audio is then unplayable on the page, I have tried everything I can think of, I have practically gone through the code line by line to see if it sets the file permissions anywhere and there is nothing out of the ordinary. From what I think it is from going through it all is that it uploads the file under the apache main user and not the php user??? Which is different from the upload script I created. On my localhost (Mac OSX) it is uploading the file under the daemon user. I have tried so hard to find out how to change this but keep coming up blank, I really need to use this script and there must be something that is simple to change. I can post the code if anyone would like but there is a lot of it, if there is any specific bit of code you think would be helpful please let me know.
  6. adamsmith replied to a post in a topic in Server Side
    // A QUICK QUERY ON A FAKE USER TABLE $query = "SELECT * FROM `users` WHERE `status`='bonkers'"; $result = $mysqli->query($query) or die($mysqli->error.__LINE__); // GOING THROUGH THE DATA if($result->num_rows > 0) { while($row = $result->fetch_assoc()) { echo stripslashes($row['username']); } } else { echo 'NO RESULTS'; } This is the only thing you need to replicate, change the query so that it queries a different table. Then do the same, I would change the $variables so you are able to differentiate between the different queries. $query = "SELECT * FROM `users` WHERE `status`='bonkers'"; $cars = "SELECT * FROM Cars WHERE Colour = 'Red'";
  7. I think I've figured it out, it wasn't actually that hard really, I just need to use a payment gateway. All the shopping cart (including discounts etc) I've already developed myself, just need to install the payment gateway part now
  8. A site that I am developing sells audio in much the same way that Beatport does. I haven't used any shopping cart systems before and they all seem too complicated for what I need, simply being able to select an audio file and clicking buy, no need to have pages for other products, every product is an audio file, simple. Would opencart be ok for what I need or is that too much? Even better, does anyone know what system beatport uses? Any advice is much appreciated, thanks.
  9. I will send you some of my precious locks that you can use in a hair transplant. This is where I downloaded lame from onto my mac and have put it on my local server (also will need uploading to the live server), I don't know which file to call using shell_exec, or will shell_exec('lame... literally just work? I can't see it being that simple somehow, I feel like I need to make the lame bundle a shell file somehow...
  10. If anyone can point me in the right direction here, I'm going bald pulling all my hair out!!! I need a script that when a user uploads a .wav audio file it gets converted to an .mp3 audio file. I've read that the best solution is to use the LAME encoder through a shell script but I've no idea how to call this in php or what I need to do or anything.
  11. You should save the image on the server, possibly in either an /images folder or a /user/images folder. You should store the name of the image in the database that can be dynamically called depending on which user is using the site.
  12. Does anyone know where I can download a script for a calendar, I've had a massive look on google but can't seem to find anything that is what I want. I need a simple calendar that displays booking times for a fitness coach, inside each day should display the times available that day and then when clicked a form displays the relevant information that the user can book.
  13. How do I set this up, I'm not even too sure on what the different types of settings are? I've read there is 'root' and 'user', how is the 'user' id generated in PHP? My site basically is where one person can upload a file and another person can download it, in a very basic description.
  14. echo '"'; print $comments[rand(0,count($comments))]; echo '"'; double quotes can go inside single quotes and single quotes inside double quotes, but not single within single and double within double.
  15. Sorry if there has been any confusion, maybe I didn't make myself clear on what I was trying to achieve. My site currently is set up and users can log in and all is good, I am trying to develop an api for the entire site for all the different features available so that mobile apps, other sites etc could use the data stored in my database. I was planning on converting my site to be a client of it's own API, maybe I won't bother as it seems to be a lot of work to achieve the same things it currently does, I just thought it might be a good idea to keep everything in line. So my question was this... When the user enters their details on the index page form and submits the data, this gets POSTed to the login script which then queries the database and returns the information, as per normal. If I was to use an API, then it would be the api.php file that queries the database, and API's usually accept GET requests so that mobile apps and 3rd party websites can connect. So, when a user submits their data and it is sent to login-script.php, would it be this file (login-script.php) that then sends the data onto api.php (which then connects the database and returns a JSON string) via file_get_contents and interprets the JSON string that is sent back from api.php, or is there a way simply from pressing the submit button on the form in index.php to send the data straight to api.php and bypassing login-script.php all together as all this file does is receive the data from the form and send it on again to the API and then interpret the JSON data, I did think about sending the form data to api.php via method=GET but then the file would just return JSON and there would be nothing to interpret it. So basically, everything needs to connect to the API instead of the database, and interpret the JSON returned from the database, like this image.
  16. my own site
  17. Thanks for the help, is that how I would best go about doing it? i.e. if someone logs into my site, when they fill the form in, and that then sends the data to say form_script.php for validation etc I then either have the choice to use cUrl or file_get_contents... so in effect I need 3 files, the form, the form script, and the api...
  18. adamsmith posted a topic in Server Side
    I am looking into redesigning my site based around an API. I think I understand correctly that you can send information to the main API page using "file_get_contents" and receiving the information as JSON. If I want to login to my site how would I do this with a form? Would I have the form POST the data to a "script" page which then sends the data using "file_get_contents"? Or is this completely wrong?
  19. It is a database query, thats all, except it's done using a cron job and saved as json. You're right it's nothing at all special I just thought it was maybe a better way of doing to decrease the amount of queries the database has to deal with, I'll have a look into caching.
  20. Because the content on my site is based off a popularity algorithm and will constantly be changing order, I thought it would be best to set up a CRON job every couple minutes to reorder the list, then save it as .json so that everytime someone visits the site, the index page pulls the data from the json file instead of the database being queried possibly thousands of times when ever users click refresh, I thought it might speed the site up a bit. Would it not? Also in the future a mobile app could be built off the back of this API
  21. I just had a quick google and these were the top 3... http://stackoverflow.com/questions/1970880/store-html-entities-in-database-or-convert-when-retrieved http://stackoverflow.com/questions/2077576/php-mysql-when-exactly-to-use-htmlentities http://stackoverflow.com/questions/3023728/php-htmlentities-on-input-before-db-insert-instead-of-on-output
  22. Hmm see I've always read that you should store the data as it is input by the user, obviously escaping the data first, but then the data should be formatted as it is needed in whatever application you are using... website, mobile app etc
  23. I'll get round to doing it at some point, it's not critical at the moment, back to the original question though, should I only use htmlentities once and after the JSON has been decoded?
  24. Should it then be done before json_encode or should it be done after json_decode, I kind of feel like after is the correct way to do it. And I do keep meaning to use PDO but it would mean going through my site and changing everything, urgh
  25. What is the securest way to transfer data between the 3 languages... 1. My data is being properly escaped before inserted into my database 2. When the data is called from the database using PHP I am then using the htmlentities function 3. I am then using json_encode and saving the data to a .json file in a folder on my server (currently it is above the root which could be a problem, if linked directly to this page it will show all the JSON data, there is no sensitive data so it isn't too much of a concern at the moment) 4. A different page on my site uses the information in the .json file so I am calling that file with file_get_contents and using the json_decode function to convert it to PHP 5. I am then using htmlentities again before the data is echoed on the page Is this the correct procedure? Is there anything else I need to be aware of? Cheers guys

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.