Jump to content

Don E

Members
  • Posts

    996
  • Joined

  • Last visited

Everything posted by Don E

  1. You can try this if it helps: $query2 = "INSERT INTO redirect(crc32,tweet,created-by) VALUES ('{$crc32}','{$string}','{$_SERVER['REMOTE_ADDR']})"; or $query2 = "INSERT INTO redirect(crc32,tweet,created-by) VALUES ('" . $crc32 . "','" . $string . "','" . $_SERVER['REMOTE_ADDR'] . "')";
  2. It appears that window.onerror gives information that is not provided by window.addEventListener... as explained in the following link for firefox. For webkit browsers however, seems to work: http://stackoverflow.com/questions/12746034/how-to-get-error-event-details-in-firefox-using-addeventlistener
  3. To add to Don Jajo's post, if $col !== 'name' evaluates to true, the if condition will not continue to check if $col!=='item' is true. The if condition in this case with 'or' also know as ||, will check from left to right which one is true, once it finds it, it will exit the condition so to speak. If you need to check if both have to be true, use &&.
  4. Hello, see if this article is of any help: http://yogeshchaugule.com/blog/2013/configure-sendmail-wamp Since you're on windows 8, you may need a few more configurations for the sendmail app to work under windows 8 for wamp.
  5. You can reset the form with: document.getElementById("myForm").reset(); instead of this: document.getElementById("txtField").onclick = reset(); reset() is only for forms I believe. Or... within the if statements that check the input from the user... take the value for the input field and set it to blank like the following when they don't guess correctly: var myInput = document.getElementById("txtField"); if (myInput.value < 0 || myInput.value > 1000) { myInput.value = ''; return outPut.innerHTML += "I said between 0 and 1000."; } if (myInput.value == "") { return outPut.innerHTML += "Please enter a number between 0 and 1000!!!"; } if (myInput.value > randomNumber) { myInput.value = ''; outPut.innerHTML += "Too High !!!"; } if (myInput.value < randomNumber) { myInput.value = ''; outPut.innerHTML += "Too low !!!"; }
  6. No it's not stupid at all. It's all a part of the learning process. The reason you're not getting 10 logged is because you're telling the loop to loop through as long as count and i are less than 10. If you change the conditional operator to <= you will see 10 logged.
  7. L8V2L, Do you have a local library? Years ago and sometimes now, I look up books online of what I would like to read in regards to programming (or anything really) and then check if my local libraries have them. If they do, great, I check out that book... if I don't like it, I simply return it and get another until I feel that book is what I am looking for. If that book is worth it to me, I actually then purchase it online somewhere via Amazon etc. As of a matter of fact, not too long ago I purchase a JavaScript book called 'PPK on JavaScript' from Amazon simply because I wanted to have it in my collection. Though it is a book that was released mid 2000s, I still wanted to check it out because the author is the person who runs this site: http://www.quirksmode.org/js/contents.html and in the book he talks about/goes over of what is considered 'bad' programming practices in JavaScript and also goes over about how to approach scenarios in regards to the many browsers that are out there when writing your code. In the book, He gives real world examples of projects He actually worked on, which is cool. The book isn't really intended for beginners but there is a chapter in the book that goes over the core of JavaScript but not too much in detail. Maybe not the book of what you're looking for at the moment. Like JSG mentioned I believe, many of the authors pour much of their knowledge into their books.. Regardless of the book, you CAN learn something from it. It's all up to you. If you have personal hurdles in the way, for example, money to get a book... libraries are free. If you have a hard time sitting in one spot and reading a 'big' book, just take it slow; no need to rush it. Rushing it is not good anyway because you may miss what's important for you to understand. IF reading a physical book is not you but prefer reading stuff online/on the computer, many of the books out there are now in PDF format where you can read the entire book on the computer or tablet, etc. There are actual 'readers' now that can read the book for you and you just listen; if that's an option for you. Don't make excuses(like how you mentioned you're not interested in books because the author gets off the topic for a paragraph or too, or is humorous in some places, personally I like that because it helps me understand the author more and their 'view' on programming thus helping me understand everything more). If you really think programming is for you and truly want to learn, you will make it HAPPEN regardless of anything.
  8. My personal favorite is google's recaptcha: http://www.google.com/recaptcha/intro/index.html (maybe not what you're looking for since you need a google account, but if you already have one, you can use that account for everything related to google)
  9. Same here. I was thinking maybe it was an alternative way in JavaScript of styling the element in an 'inline' styling way like <div style="width: 100px; height: 100px; margin: 0 auto"></div>
  10. Both upload_highlights.php and highlight_upload.php are located in the Highlights directory along with the Videos directory? For the move_upload_file function, for the destination try if one of these work: $location = "Videos/" . $name;$location = "MembersArea/Highlights/Videos/" . $name; //don't need public_html before MembersArea Also, after viewing the php.ini you made at http://bellgroveafc.com/php.ini, I don't think it's being used. When setting this:SetEnv PHPRC "/home/bellg980/public_html" .. it should point to the php.ini file. So something like: SetEnv PHPRC "/home/bellg980/public_html/php.ini" but probably not a good idea to have in your public_html directory since everyone would be able to see it. Also when setting values in a php.ini file, you don't need to have single/double quotes. (For most values) See this link for more info on PHPRC: http://webmaster.iu.edu/upgrade/phprc.phtml
  11. Ah ok, looks like its loading now but going very slow. For sake of narrowing down the issue, can you post your recent updated code in code tags for uploading the videos, both html and php code?
  12. The whole site seems down at the moment. Are you sure its something with the hosting company on why the site is currently down?
  13. Since the phpi.ini file is the same for everyone and upload_tmp_dir in the php.ini is set to /tmp, either it means the tmp folder of the server or the tmp folder for your account, I'm not sure. If it means the tmp folder for the server, then no you cannot move a file from that location to your account, like the person you chatted with said:"Script is not working because during the upload it tries to create /tmp/phpwQFTYv on server's end, yet it can't be created as it's not permitted, due to security reasons. So basically previous assumption was correct, tmp directory which your script creates should be created within your account's home directory, not entire (shared) server's which is the reason it doesn't work. Your script should grab file from temporary directory which is in your public_html folder." If it means the tmp folder for your account then, then make sure you have a tmp folder there which I'm sure you do. Have you tried using a smaller video size or how about trying to upload an image? This problem could be maybe from using a file size that's bigger than what's allowed in the php.ini settings. Try uploading an image that's fairly small in size and see if it gets uploaded and moved to the directory.
  14. From the looks of your PHP info out put, the php.ini file ithat is loaded and being used s located at: /usr/local/lib/php.ini This is a global one most likely, meaning everyone under that server is using that php.ini file. So in other words, everyones' tmp directory where uploaded files go to, is the same. I went to hosting24 and I'm having a chat with them via live webchat and it appears that for shared hosting accounts, people are not allowed to edit the php.ini file and everyone is using the global one. So in other words, everyones php settings(configurations) are the same. Here's part of the chat: 15:40Elvin S.: Hello and welcome to Hosting24.com, how may I help You? 15:42Don: Hi. I was wondering on the shared hosting plan, will I be able to edit the php.ini file for my account incase I need to change any settings like the POST max size, etc? 15:42Elvin S.: Unfortunately you will not be able to edit it. 15:42Elvin S.: You would need VPS in order to access php.ini 15:46Don: Oh ok, so basically all php settings are the same for shared hosting accounts. Are file uploads allowed with shared host accounts? 15:47Elvin S.: Yes, the settings are the same Since file uploads are allowed AND you're not allowed to edit the php.ini file to your specifics, then one or two(or more lol) things could be causing our problem: the video you're trying to upload is TOO big in size which exceeds the php allowed size for file uploads, OR, IF the video you're uploading doesn't exceed the php values set for file upload sizes etc and is actually being uploaded to the server, then when moving the file with move_upload_file function, the path is not correct. I see that in the first snippet of code you posted, you used this for the destination: move_uploaded_file($tmp_name, "/home/user/public_html/MembersArea/Highlights/Videos/" . $name); //user most likely has to be your user account name: bellg980 Instead try: move_uploaded_file($tmp_name, "/home/bellg980/public_html/MembersArea/Highlights/Videos/" . $name); Good luck.
  15. What hosting company is this? Just wonderingWhen you log into your account, are you presented with something like a cPanel? This is a demo of a cPanel: http://x3demob.cpx3demo.com:2082/cpsess8155144553/frontend/x3/index.html?post_login=72861321213447 What else you can try to see what is going on is by creating a php file called something like phpinfo.php and inside the file, you have this: <?php phpinfo();?> Upload that to the directory where your website files are and go to it by going to your browser and typing in: mysite.com/phpinfo.php (mysite would be your site domain). You should get/see information regarding your PHP like the version you're using etc. Also it should tell you what(meaning what php.ini file is loaded because its possible you may have a couple or so) and where your php.ini configuration file is located at. IF you don't have access to a php.ini file then it looks like the one you're using is the 'global' one for the server you're on. I'm a bit surprise by that since usually(and in my case when I was on shared server), everyone had their own php.ini file. This HAS to be because for example, it doesn't make sense that everyone is using the same php.ini file when for example, one person on the server doesn't need to increase the POST max size while another person might need to increase to allow POST data of more than the default set size which I think is 2M (MB).
  16. It means the script is looking in the wrong directly for the uploaded file. It is looking in the /tmp directory of the server itself. The tmp folder the script should look for, for uploaded files is in your 'home' directory which I assuming is somewhere in here: /home/bellg980/public_html/. Could be in: /home or /home/bellg980 or /home/bellg980/public_html/.To see exactly where PHP is looking for tmp files, go into your php.ini file and look for this to see the path for the PHP tmp folder for your account on the server: upload_tmp_dir = path should be here to tmp folder For example, it should look something like this: upload_tmp_dir = /home/bellg980/tmp Use the file manager for your account to see where the tmp folder is and if the above is not set to the correct tmp folder, set it to whatever the tmp folder is for your account. It's possible this setting is set to something else for you causing you to experience what you're experiencing. From what I understand when I use to be on a shared hosting environment, everyone on the server has their own php.ini file. So in other words, you cannot be using a 'global' one where the same settings apply to everyone on the server. In other words, this may be an issue with your php.ini file. (Maybe not though)
  17. Everything seems okay... Make sure the $location path is correct and that permission is allowed to move files to that directory. Check your server error logs to see if an error is outputted when attempting to run the above script. If everything is good with the code and the path is correct, then it may be a 'permissions' problem.
  18. This may be why you're getting the mysql errors: $sql = mysql_query("SELECT * FROM highlight"); $result=mysql_query($sql); $rows=mysql_fetch_array($result); mysql_query is being called twice and the result of the first call is stored in $sql and then you call mysql_query again passing the result of the first call. Try (I'm assuming you made database connection in db.php) : $sql = "SELECT * FROM highlight"; $result=mysql_query($sql); $rows=mysql_fetch_array($result); This may or not may be related to the file disappearing after upload, but most likely it's the mysql errors you've come across. Try setting a return variable to the move_uploaded_file function to see if it's success or not (true or false). It returns true on success or false on fail. $status = move_uploaded_file($tmp_name, "/home/user/public_html/MembersArea/Highlights/Videos/" . $name);if($status){ echo 'Uploaded';}else{ echo 'Uploaded Failed';}
  19. Are you getting any errors from PHP?Try adding this to the top of your code: ini_set('display_errors', 1); error_reporting(E_ALL);
  20. It may be because you're missing a semi-colon for $name. $name = "bellgrove_slide_show.mp4";
  21. To add to davej's post, the id attribute basically allows you to set an "identifier" for a particular html element. It's a way to allow you to target an html element when necessary like with JavaScript(getElementById) and CSS. There can only be one id of the same name per webpage. When you get an element by ID with getElementById, you now have access to that particular element and can manipulate that element like setting it's innerHTML or setting a className to it... or accessing the 'style' for that element and then change some of the styling for that element, like font color, background color, display, etc.
  22. So what you're doing to do is.... the user enters info into a form and hits submit(first click), the form gets processed and then the PayPal button appears for the user, but instead of the user clicking on the BuyNow button(this would be second click, what you don't want I believe), you want the user to automatically go to the PayPal page to make purchase as if they already clicked on the BuyNow button?
  23. Site opened for me. What error message(s) are some of the non-connecting users having after they attempt to connect to your site?
  24. Don E

    php and mysql

    Show us the code you're writing to create tables with PHP. As I'm sure you're aware, you can create tables(for a database) via phpmyadmin as well.
  25. Don E

    php and mysql

    What are you using to develop; WAMP, XXAMP, MAMP, LAMP? Or on a live server? Maybe you need to update your PHP to a version that supports mysqli, PDO. If you're using a version that has mysqli/PDO support, then something wrong with configuration somewhere most likely.
×
×
  • Create New...