Jump to content
Larry Ullman's Book Forums

Jaepee

Members
  • Posts

    76
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Jaepee

  1. Any code behind those pages for us (non-Larry guys) that might want to help? have you tried running a query in phpMyAdmin or databse command line? like mysql> SELECT * FROM coffee WHERE myCoffee='darkroast'; have you tried printing out the variables to the screen to make sure your query is showing what you are expecting? <?php $sql = "SELECT * FROM coffee WHERE myCoffee='$myAwesomeDarkRoastVariable'"; echo $sql; ?>
  2. Notice: Undefined index This notice appears when you (or your PHP script) atempts to access an undefined index of an array. You can avoid these notices by, checking with your code to see if the index exists before you access it. For this you can use isset() or array_key_exists() Note that theses notices appear often when working with $_POST, $_GET or $_SESSION. It is good practice to make sure a variable exists and is set before you use it. Happy Coding! jp
  3. Hey everyone, I've been busy with programming. I haven't stopped by here in a while. Just though i'd share my first app that is now in the Apple App store. It was quite a journey to say the least but I made it. The App is called "Type It, Say It". You can type anything you want into the text field and the system voice (Siri) will say it back to you. Check it out if your an Apple user. https://appsto.re/us/6ozdeb.i Thanks J
  4. Okay I am back to show some projects. I have deviated from javascript a bit to blur on objective-c with php backend. I am posting a link to the current project I am working on. It's a video of an app I am making that loads data from a php script. https://www.youtube.com/watch?v=kEB4oHJ__0s Its still a work in progres. Sorry about the music in the background I was veging out coding and listening to music. jp
  5. Jaepee

    Forum Back Up

    I have missed the forums! Glad They're back online!! Hope all is well with everyone!
  6. Try this, make a random string, then assign it to the user. <?php function random_str() { // all this returns is a random string!!! // get all the characters into an array $randomStr = str_split('abcdeghjkmnpqrstvwxyzABCDEFGHJKMNPQRSTVWXYZ23546789'); // splits all the characters into an array() shuffle($randomStr); // randomize the array() $randomStr = array_slice($randomStr, 0, 4); // get the first 4 (random) characters out $base = implode('', $randomStr); // smush them back into a string return $base; // we have our new random string } // end random function // then call the function echo random_str(); I tested it and it works. You can adjust the number of characters from 4 to however long you would like your string.
  7. Hi Grahamgr3, do you have any code that we could see to help you identify your issue? Maybe you could add an if statment in the session code. Verify that the user can only see his page. if ($_SESSION['user_id'] != $_GET['id']){ // redirect user to auth page }
  8. Ionezation your code worked in my browser.. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Submit</title> <meta name="generator" content="TextMate http://macromates.com/"> <meta name="author" content="Jp"> <!-- Date: 2014-01-07 --> <script> function calculate(){ 'use strict'; var total; var quantity = document.getElementById('quantity').value; var price = document.getElementById('price').value; var tax = document.getElementById('tax').value; var discount = document.getElementById('discount').value; total = quantity * price; tax = tax/1000; tax = tax + 1; total = total * tax; total -= discount; document.getElementById('total').value = total; return false; }; // end of calculate() function function init(){ 'use stric'; var theform = document.getElementById('theform'); theform.onsubmit = calculate; }; window.onload = init; </script> </head> <body> <h1>CALCULATOR FOR SHOP</h1> <form id="theform" method="post"> <fieldset> <label>Quantity</label> <input type="number" name="quantity" id="quantity" value="1" min="1" required> <label>Price per unit</label> <input type="number" name="price" id="price" value="1" min="1" required> <label>Tax Rate(%)</label> <input type="text" name="tax" id="tax" value="0.0" required> <label>Discount</label> <input type="text" name="discount" id="discount" value="0.0" required> <label>Total</label> <input type="text" name="total" id="total" value="0.00"> <input type="submit" value="Submit" /> </fieldset> </form> </body> </html>
  9. Thats cool about your Ubuntu class Antonio. Do you know how to configure dns using bind or bind9? I am trying to learn how to set up my server as a name server but don't know where to start. Thanks jp
  10. Thanks Guys, Just thought it would be a great experience to try and set up a server. I have tried the GoDaddy.com virtual servers but they limit your bandwidth and disk space and cost like 39.99 a month and up. Larry your right, hosting a site from a house is not recommended. But it is pretty fun, and a great learning exp. jp
  11. Since this is a "SHOW US YOUR PROJECTS" post I figure I would post something else that I have been working on. Its not 100% programming related but computer related, yes; yes it is. http://blu.re/VDF5 Dell POWEREDGE 1950 web server. Generously provided to me from an internet company here in the Bay Area. I can now host all of my websites here at home on my 30mpbs internet connection. I have ubuntu 12.04 server and set up virtual hosting, currently hosting two domains.
  12. Thanks.. I did think of using css3 however it was not working for IE7 and I wanted to make the code work on the old laptop I was working on. All devices I have tested the code on has worked so far, so I am pretty happy with the fade. It was more of a "will this work?" type approach to the fade. I got it to work.
  13. Hi everyone!! how y'all doing.. It has been fun learning javascript. I've actually been working on javascript more that php lately. Just wanted to show a small page I've been working on. This page takes an image and resizes it based on the browser window size vs picture dimensions. It will even resize the picture if the window is resized and it keeps the proper image ratio, and fades the background color to black. http://blure.com/test/viewport_works_not_min.php How does it look in your browser? jp
  14. Just an update on this post ... I have been working on an object that I think has finally covered most browsers to get the modal mask to correctly fit on any screen dimensions. var v = { // view object h : function(){ var hi = window.innerHeight; if (typeof hi != 'number'){ if (document.compatMode == "CSS1Compat"){ this.hi = document.documentElement.clientHeight; } else { this.hi = document.body.clientHeight; } } return hi; }, w : function(){ var wi = window.innerWidth; if (typeof wi != 'number'){ if (document.compatMode == "CSS1Compat"){ this.wi = document.documentElement.clientWidth; } else { this.wi = document.body.clientWidth; } } return wi; } }; var win_x = v.w(), win_y = v.h(); use variables to style your css as needed e.g. document.getElementById('modalMask').style.height = win_y +'px'; document.getElementById('modalMask').style.width = win_x +'px'; any suggestions please let me know.. jp
  15. Hello Have you verified the user that you are logged in as such as SELECT user(); from the mysql command line?
  16. Cool app David John. Thanks Red! I have made a little more progress, I now have a sign-up with facebook feature. Which is pretty neat in the fact that you don't have to remember yet another password. It has been definitely a learning experience. Which I feel has helped me understand php and the facebook api. All thought no one uses my site other than my wife and I like having a site to work on and of course practice the skills of which I am learning. There is so much to learn and so little time. I also made a like button for my picture page. I had just recently found a picture that I though was lost forever. It was of my best friend, myself and Joe Satriani. My friend was suppose to have a guitar lesson with him but we got lost in the city and had to settle for just a Picture... http://blu.re/5Yw7
  17. Hello Rob! Do you have any code that we can see? So we can give it a look see! jp
  18. .com is the most valuable name all the way. Have you tried gandi.net? I have several domains registered with them. You can get almost every extension. When there is a country or government restriction on extension. I use MARCARIA.com to get a country restricted domain. First domain I bought was back in 1999. I have about 100 or so domains. (some very valuable). My 11th grade teacher told me circa 1994 - 1995 to register a domain / start an online business after school. Like every name was availiable then. But being the not so brite student I was, I thought that the internet was part of school and I hated school. I should have listerned to Ms. Anderson. Plus the names where like $50 bucks. ...sigh.... I missed out on the dot com version of my name that I originally wanted. I did get the .net .org and other names after I came to my senses. I do however believe Larry when he says that content and a reason to return to your website and is more valuable than a name. You should build a brand and identity. (imoo). Although my profession is Heating Ventalation Air Conditioning. The biggest department is Preventive Maintenance. They call it HVAC in the industry. Every internet company / Data Center / Google / what have you, needs cooling or HVAC preventive maintenance for their CRAC units or CRAH units to cool their servers. Thus, I registered the domain http://hvac.pm/ There are billion dollar mechanical hvac contractors that would love to own my name. But, I am saving it so that If my web project doesn't go as planned, I'm just gonna start an air-conditioning company named "hvac(dot)pm". jp
  19. Thank you sir. But, would $cs = new CSESSION($ip); call the same class as $cs = new CSession($ip); I thought that classes were or are case sensitive? I have been coding JavaScript a little to much I forgot. Sorry if my post is off topic. I do find that if I do not code in a certain language for a while BOY do I get Rusty and ofcourse I love coding php. I would love to remember everything that I learn however that seems to not be the case in my small programming life. jp
  20. Correct me if I am wrong but spelling is incorrect, shouldn't it be \/ \/ \/ \/ \/ $cs = CSESSION($ip);
  21. Hey Guys just checking In again. Sorry I've been away from the forums for a while. But, life happens right. My project is going a little slower than I though. But I hit a milestone last night. I successfully coded (learned / and in the process of learning still). The facebook-php sdk (API I think I am naming it correctly). It is surprisingly simple yet very complex. I created a facebook app, interfaced the Login, requested post wall permissions, and posted a picture to my facebook wall. http://blu.re/mKTb This link shows my timeline and the picture of a blurry Mark Z. ... lol If you click the link "see only this picture" and zoom in on the top of the picture it says, "via blurE.com" Although I still have to integrate the code fully into my album script.php, I am totally excited about this functionality because now my friends and family that Have blurE accounts can send pictures to facebook, and Pinterest. Next up will be twitter. Or create a mobile version. I still don't know yet. It all started by reading a nice book on PHP, written by of course, the owner of this forum! Thanks Guys J.P.
  22. That's Great! Code on bruda! or (Sista!... profile didn't say gender) Im just paying it forward when I can, cause there is a ton of help on this forum. This is the only spot on the internet for coding help (as far as I am concerned) that is worth while. I keep coming back and learning from all the loyal members, especially when I read other members coding troubles & solutions. jp
  23. Hello Sandari '3210 8888,' should be '3210 8888', I've been there , Iv'e done that.
  24. Thank You HartleySan for clarifying that for me. I'll use the traditional event model.
  25. Hi Everybody, I have a quick question to add to this thread regarding the onload event. I've coded the Utility script in chapter 8 of the book and was wondering if it would be a good idea or not to use the addEvent: function for the window "load" event. Example: U.addEvent(window, "load", popA); // function popA(){ alert("This is an Alert called using the Utility script"); } Would the above code make the javascript more cross-browser friendly? or will all browsers understand the basic: window.onload = function(){ alert('This alert is from onload event'); } I am just trying to clarify this concept, and any input or recommendations would be great. Thanks jp
×
×
  • Create New...