Jump to content
Larry Ullman's Book Forums

Jaepee

Members
  • Posts

    76
  • Joined

  • Last visited

  • Days Won

    4

Jaepee last won the day on January 8 2014

Jaepee had the most liked content!

Jaepee's Achievements

Newbie

Newbie (1/14)

15

Reputation

  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?
×
×
  • Create New...