Jump to content

Fish181

New Members
  • Posts

    8
  • Joined

  • Last visited

Fish181's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, I want to put an opaque background behind my website that is a project for school. Here's my project for school: http://gyazo.com/33eddfa1242478b0cdf53dbda114df5a And what I want is an opaque background like the ones found on twitter: http://gyazo.com/59afbe6c4fe9cba669acca916e547c8a http://gyazo.com/55bfed8a0e2431d4acc02f41b72496eb I'm a pretty big noob when it comes to this so any help would be greatly appreciated.
  2. I thought of a great idea for an app. This idea obviously isn't something you could make in a day, maybe not even within a year. My idea is to make an app where you could snap a picture of someone's face, then you can use a facial recognition algorithm to find that person's twitter/facebook etc. I personally think that it is possible, but you wouldn't be able to use that person's profile picture on their facebook/twitter. The website, or the app's website, would have to create a database of faceshots of the individual that is uploaded by them that would only be used for locating their social media. What are your thoughts?
  3. Hi! I'm making a time laps calculator based off of the equation found http://americandslr.com/2010/10/time-lapse-calculator/ there. I'm completely done with the functional part of it. Now I need to worry about the aesthetic part of it. Here is the code: <?php if (isset($_POST['filming'])) $hour = $_POST['filming']; if (isset($_POST['framerate'])) $framerate = $_POST['framerate']; if (isset($_POST['dtrt'])) $dtrt = $_POST['dtrt']; $half = $hour * 3600; $halftwo = $framerate * $dtrt; $answer = $half / $halftwo; ?> <!DOCTYPE html> <html lang='en'> <head> <title>Timelapse Calculator</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Bootstrap --> <link href="css/bootstrap.min.css" rel="stylesheet" media="screen"> </head> <body> <div class="well span 5"> <form class="form-horizontal" method="POST"> <fieldset> <!-- Form Name --> <legend><h1><center>Timelapse Calculator</h1></center><br></legend> <!-- Text input--> <div class="control-group"> <label class="control-label" for="filming"><strong>Film Time (in hours)</strong></label> <div class="controls"> <input id="filming" name="filming" type="text" placeholder="type here..." class="input-medium" required=""> <p class="help-block">1 hour would be "1", 1 and a half hours would be "1.5" etc. </p> </div> </div> <!-- Text input--> <div class="control-group"> <label class="control-label" for="framerate"><strong>Frame Rate</strong></label> <div class="controls"> <input id="framerate" name="framerate" type="text" placeholder="type here..." class="input-medium" required=""> <p class="help-block">How fast will it be presented?</p> </div> </div> <!-- Text input--> <div class="control-group"> <label class="control-label" for="dtrt"><strong>Duration</strong></label> <div class="controls"> <input id="dtrt" name="dtrt" type="text" placeholder="type here..." class="input-medium" required=""> <p class="help-block">How long do you want the time lapse to last? <u>IN SECONDS</u></p> </div> </div> <!-- Button --> <div class="control-group"> <label class="control-label" for="submit"></label> <div class="controls"> <input type="submit" class="btn btn-primary btn-large" value="Submit"/> </div> </div> </fieldset> </form> <h2><center><strong><?php echo $answer . " seconds between picture" ?></center></strong></h2> </div> <script src="http://code.jquery.com/jquery.js"></script> <script src="js/bootstrap.min.js"></script> </body> </html> (yes i'm using bootstrap) Here is a screenshot of what it looks like before and after you submit: Before submission: http://gyazo.com/361d109f0af010fcda4d90288b338566 After submission: http://gyazo.com/cf1c2c2089af3f6b4bf349aeab7fc1d4 1. how do I make it round to the nearest tenth? When I used "round($answer, 1);" it crashed my script. 2. How can I make the "seconds between picture" only appear after you press submit? Thanks, I'm a noob. Fisher
  4. Hi, Here's the source code: <?php error_reporting(-1); //defines the database information needed in order to link to the database define ('DB_NAME', 'questions'); define ('DB_USER', 'root'); define ('DB_PASSWORD', ''); define ('DB_HOST', 'localhost'); //the actual link between PHP and MySQL below $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); //error just incase it doesn't work so I can tell what's wrong if (!$link) { die('Could not connect: ' . mysql_error()); } //This selects the database I want to use and links it via msq_connect $db_selected = mysql_select_db(DB_NAME, $link); //incase of an error if (!$db_selected) { die('Can\'t use ' . DB_NAME . ':'.mysql_error()); } $query = "SELECT * FROM `questions_user` ORDER BY id DESC"; $result = mysql_query($query); if (!mysql_query($value)) { die('Cannot obtain $query!' . mysql_error()); } if (mysql_num_rows == 0) { echo 'There are no queries at this time!'; die; } while($data = mysql_fetch_row($result)){ echo $data; } mysql_close(); ?> When I load the page I get a "query was empty" error. The DB name is questions The DB table is questions_user The DB fields are `ID` and `questions_field` This is some of the first interactive things i've made combining mysql and php. I know the code is probably sloppy. Thanks for helping me out, Fisher P.S. I'm trying to output the data from 'questions_user' to just a random spot on a webpage.
  5. Thanks a ton! I'll be sure to check out those two options as well.
  6. Hi, I'd like to apologize if I sound like a noob. Other than a book on dummies about php and mysql, I'm new to php and mysql combined. Here is the code where my form is: <class="form-horizontal"> <!-- this is bootstrap form type --> <div id="question"><h1>Have a question?</h1></div> <div class="well span5"> <div class="control-group> <!-- made for each form type --> <div class="control-label" for="name"><strong>Query</strong></label> <div class="controls"> <!-- start form stuff here --> <form action="queries.php" method="post" /> <input type="text" class="span5" placeholder="Type your question here!" name="user_questions" /> <input type="submit" value="Submit" class="btn-primary" /></button> </form> </div> </div> </div> </div> as you can see, the name of the form is "user_questions and the php script linked to it is queries.php. Here is the php code linking mysql to the form: <?php error_reporting(-1); define ('DB_NAME', 'questions'); define ('DB_USER', 'root'); define ('DB_PASSWORD', ''); define ('DB_HOST', 'localhost'); $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if (!$link) { die('Could not connect: ' . mysql_error()); } $db_selected = mysql_select_db(DB_NAME, $link); if (!$db_selected) { die('Can\'t use ' . DB_NAME . ':'.mysql_error()); } echo 'Connected successfully'; $value = $_POST['user_questions']; $sql = "INSERT INTO questions_user (questions_field) VALUES ('$value')"; if (!mysql_query($sql)) { die('Error: ' . mysql_error()); } mqsql_close(); ?> (yes i'm aware that having root and no password is very dangerous. This website that i'm making is only a project i'm doing to gain more experience.) As you can see. The script will die if anything doesn't work and it will give me an error message. However if it successfully gets through linking the database then it will say "successfully connected". When I put a query into my form and submit, I'm sent to the queries.php page where it says "successfully connected". Since I haven't made any redirecting or anything it just stops there. But then I go to my database to see if the data is stored and it is empty. **DATABASE INFO** The db name is "questions" The only table is "questions_user" The 2 fields are "ID", which is the primary key with A I and "questions_field" which stores the data with TEXT. If you need anything else just let me know. It's driving me insane. Thanks, Fisher
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.