Jump to content

Search the Community

Showing results for tags 'html'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

  1. So basically I am still starting off when it comes to learning PHP/MySQLi... I am looking to make a script that can do the following: If I update say my homepage by just my normal cPanel editor plus another page named "News" but through an Admin section on my site (so basically inserting a new row into the database instead of manually doing it through my cPanel) - I would like it to display in a section on my homepage that days date along with the list of pages that were updated underneath it within that date, but with names I give the pages so instead of just saying index.php updated, I want it do say "Home Page Updated." I did have an attempt at this but just couldn't get it right. I would like to set a limit on how many different dates can be shown also. Example: July 12, 2014 Home Page Updated. News Headlines Updated. Staff Members Updated. July 11, 2014 Home Page Updated. July 10, 2014 Home Page Updated. Contact Us Updated. and so on... Thank you to anyone who replies with some input, I have been going crazy trying to get this right and I just can't get it but badly want it..
  2. Hello guys, first post here. I have a web system which contains a login form programmed in 3 different languages HTML, PHP and JS. The problem is that it's not working, you can access without entering any data, you just press enter and it will work, I don't know why it is not validating any credentials. I was thinking about some query problems but I don't know. I am a newbie on this. I have read a lot but haven't found an answer. A friend helped me build the system but left that uncompleted and he's nowhere to be found. I was wondering if you could help me out with this. <form role="form" ng-submit="login(user,password)"> <div class="form-group"> <input type="user" class="form-control" ng-model='user' placeholder="Usuario"> </div> <div class="form-group"> <input type="password" class="form-control" ng-model='password' placeholder="Contraseña"> </div> <div class="alert alert-warning" id='alert' style="display:none">Revise la informacion...</div> <div class="alert alert-danger" style="display:none" id='alertErr'>Error Usuario o Contraseña Erronea intentelo de nuevo</div> <button type="submit" class="btn btn-primary">Ingresar</button> </form> <?php require_once 'database.php'; $db = new Database(); $body = json_decode(file_get_contents('php://input')); $user =$db->query("SELECT * FROM usuario WHERE usua_login = '".$body->user."' AND usua_pass = '".$body->password."'"); if($user == false){ http_response_code(404); } else{ http_response_code(200); echo json_encode($user); } ?> 'use strict'; /** * @ngdoc function * @name belkitaerpApp.controller:MainCtrl * @description * # MainCtrl * Controller of the belkitaerpApp */ angular.module('belkitaerpApp') .controller('MainCtrl', function ($scope,$http,$location) { $scope.login = function(user,password){ console.log('Login...'); if(user =='' || password ==''){ $('#alert').show("slow"); setTimeout(function() { $('#alert').hide('slow'); }, 3000); } else{ $http.post('../serverSide/login.php',{user:user,password:password}).success(function(data){ console.log('OK!'); $location.path('/products'); }).error(function(data){ $('#alertErr').show("slow"); setTimeout(function() { $('#alertErr').hide('slow'); }, 3000); }); } } });
  3. How to do that when you turn 360 degrees no longer come back? Only in this way was? Thanks. If you have any suggestions for my problem, please help. I can not think of anything related to finding a solution to the problem. I warmly greet. DEMO: http://codepen.io/anon/pen/ozAHu
  4. Hi, i'm trying to display db(name,email,telephone no) values in textbox.please help me. ::HTML part:: <form class="form-signin" role="form" id="form1" action="post_user.php"> <label class="">Name</label> <input type="text" class="form-control" placeholder="Your Name" value="" required name="yname" id="yname" autofocus ><br/> <label class="">Email</label> <input type="text" class="form-control" name="email" id="email" placeholder="Email address" required > <br/> <label class="">Telephone Number</label> <input type="text" class="form-control" pattern="\d+" placeholder="Telephone" name="telephone" required><br/> <div class="col-md-4 col-md-offset-4"> <button class="btn btn-lg btn-primary btn-block" type="submit">Submit Ad</button> </div> </form> ::post_user.php:: <?php $con = mysql_connect("localhost","root",""); if(!$con) { die('Could not connect:'.mysql_error()); } mysql_select_db("biz",$con); $mail=$_POST['email']; $query = mysql_query("SELECT yname,mail,tp FROM reg WHERE mail = '$mail' "); while($row = mysql_fetch_array($query)) { echo $row['yname']; echo $row['mail']; echo $row['tp']; } mysql_close($con); ?>
  5. OKKK! good day please i have little problem that is now a mighty one before me. I added a login form to a page using Iframe modal class i got from tinybox2. I have been able to login the user and in use the HEADER function to redirect the user to their user_page but the direction is done in the I-frame and not the parent window. Now my problem is how do i close the iframe and still redirect the user to the next page. I tried some javascript but all to no avail . THE LOGIN AND I-FRAME PAGE SCRIPT <?php if(empty($errors)=== true){ $login=login($username, $password); if($login === false){ $errors[]='INVALID LOGIN DETAILS.... PLEASE CHECK YOUR DETAILS AND TRY AGAIN.'; } else{ $_SESSION["user_id"]=$login; ?> <script> parent.window.close();</script> <?php header("location:user_page.php"); } } if(empty($errors)=== false){ $_SESSION["errors"]=$errors[0]; } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Login</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="apple-mobile-web-app-capable" content="yes"> <link href="css/signin.css" rel="stylesheet" type="text/css"> </head> <body> <div class="account-container"> <div class="content clearfix"> <form action="#" method="post"> <h1>Member Login</h1> <div class="login-fields"> <p>Please provide your details</p> <div class="field"> <label for="username">Username</label> <input type="text" id="username" name="username" value="" placeholder="Username" class="login username-field" /> </div> <!-- /field --> <div class="field"> <label for="password">Password:</label> <input type="password" id="password" name="password" value="" placeholder="Password" class="login password-field"/> </div> <!-- /password --> </div> <!-- /login-fields --> <input class="login-fields_submit" type="submit" name="login" value="Log In"> </form> <?php if(isset($_SESSION["errors"])){?> <h1 style="background:darkred;margin-bottom:-27px;font-size:9px !important;"> <?php echo $_SESSION["errors"]; unset($_SESSION["errors"]);?></h1><?php }?> </div> <!-- /content --> </div> <!-- /account-container --> </body> </html>
  6. I read this article. About two thirds down it mentions that you can turn off autocomplete on the entire form if you put it in the form tag. The post is from 2011 though so I was wondering if it is still valid? Does anyone know if this is still correct? So, can I use something like; <form action="example.php" autocomplete="off"> First name:<input type="text" name="fname"> Last name: <input type="text" name="lname"> E-mail: <input type="email" name="email"> <input type="submit"> </form> Or do I need something like; <form action="example.php"> First name:<input type="text" name="fname" autocomplete="off"> Last name: <input type="text" name="lname" autocomplete="off"> E-mail: <input type="email" name="email" autocomplete="off"> <input type="submit"> </form> To be sure...
  7. I am trying to add a simple pagination to my page. I know there are tons of tutorials out there for this. Well I have taken one of them and used my own queries with it. Below is the code. The records do show up. The only problem is that all the records(from mysql table) show up, as oppose to limiting them per page. Can you take a look at it and tell me what I might be doing wrong? try { // Find out how many items are in the table $total = DB::getInstance()->query("SELECT COUNT(*) FROM records"); // How many items to list per page $limit = 20; // How many pages will there be $pages = ceil($total / $limit); // What page are we currently on? $page = min($pages, filter_input(INPUT_GET, 'page', FILTER_VALIDATE_INT, array( 'options' => array( 'default' => 1, 'min_range' => 1, ), ))); // Calculate the offset for the query $offset = ($page - 1) * $limit; // Some information to display to the user $start = $offset + 1; $end = min(($offset + $limit), $total); // Prepare the paged query $stmt = DB::getInstance()->query("SELECT images.*, records.* FROM records LEFT JOIN images ON records.user_id = images.user_id ORDER BY record_id LIMIT {$limit} OFFSET {$offset}"); if($stmt->count()) { // Display the results foreach($stmt->results() as $row) { $thumb_img = escape($row->thumb_path); $title = trim($row->title); ?> <div class="item"> <?php echo $thumb_img; ?> <?php echo $title; ?> </div> <?php } } else { echo '<p>No results could be displayed.</p>'; } // The "back" link $prevlink = ($page > 1) ? '<a href="?page=1" title="First page">«</a> <a href="?page=' . ($page - 1) . '" title="Previous page">‹</a>' : '<span class="disabled">«</span> <span class="disabled">‹</span>'; // The "forward" link $nextlink = ($page < $pages) ? '<a href="?page=' . ($page + 1) . '" title="Next page">›</a> <a href="?page=' . $pages . '" title="Last page">»</a>' : '<span class="disabled">›</span> <span class="disabled">»</span>'; // Display the paging information echo '<div id="paging"><p>', $prevlink, ' Page ', $page, ' of ', $pages, ' pages, displaying ', $start, '-', $end, ' of ', $total, ' results ', $nextlink, ' </p></div>'; } catch (Exception $e) { echo '<p>', $e->getMessage(), '</p>'; } ?>
  8. Good Day Here is the code of my readmore page where everything is displayed right? $pdo = Database::connect(); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql = "SELECT * FROM properties where PropertyId = ?"; $q = $pdo->prepare($sql); $q->execute(array($propertyid)); $dataproperty = $q->fetch(PDO::FETCH_ASSOC); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql1 = "SELECT * FROM images WHERE PropertyId = ?"; $q1 = $pdo->prepare($sql1); $q1->execute(array($propertyid)); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql2 = "SELECT * FROM agent WHERE PropertyId = ?"; $q2 = $pdo->prepare($sql2); $q2->execute(array($propertyid)); } echo '<div class="col-md-12">'; while ($row = $q1->fetch(PDO::FETCH_ASSOC)) { echo '<a href="'.$row['ImageUrl'].'" data-lightbox="images"><img width="200px" src="'.$row['ImageUrl'].'"></a>'; } echo '<div class="proj_descr1"><h1>'. $dataproperty['Title'] . '</h1></div>'; echo '<div class="proj_descr_txt">'.'<h4><b>Description: </b></h4>'. $dataproperty['Description'] . '</div>'; But here I have a issue, because here is to display my images of the agents from my agents disrectory: while ($row2 = $q2->fetch(PDO::FETCH_ASSOC)) { echo '<img width="200" scr="'.$row2['AgentImage'].'">'; } echo '<div class="proj_descr_txt">'.'<h4><b>Contact Details: </b></h4>'. $dataproperty['ContactDetails'] . '</div>'; And here I have the code of my create page where my properties get created, the last 2 bits of code is for my images uploads but it needs to upload it to separate directories like it is indicated: $pdo = Database::connect(); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql = "INSERT INTO properties (title,description,country,location,status,type,bedrooms,bathrooms,parking,price,fromthe,contactdetails) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; $q = $pdo->prepare($sql); $q->execute(array($title,$description,$country,$location,$status,$type,$bedrooms,$bathrooms,$parking,$price,$fromthe,$contactdetails)); Database::disconnect(); } $last_id = $pdo->lastInsertId(); $directory="uploads/"; $a=0; foreach ($_FILES['file']['name'] as $nameFile) { $ext = pathinfo($nameFile, PATHINFO_EXTENSION); if(is_uploaded_file($_FILES['file']['tmp_name'][$a])) { move_uploaded_file($_FILES['file']['tmp_name'][$a], $directory.$last_id."_".$a.".".$ext); } $fileandpath = $directory.$last_id."_".$a.".".$ext; $pdo1 = Database::connect(); $pdo1->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql1 = "INSERT INTO images (propertyid,imageurl) values(?, ?)"; $q1 = $pdo1->prepare($sql1); $q1->execute(array( $last_id,$fileandpath)); Database::disconnect(); $a++; } $last_id1 = $pdo->lastInsertId1(); $directory1="agents/"; $a1=0; foreach ($_FILES1['file']['name'] as $nameFile1) { $ext1 = pathinfo($nameFile1, PATHINFO_EXTENSION); if(is_uploaded_file($_FILES1['file']['tmp_name'][$a1])) { move_uploaded_file($_FILES1['file']['tmp_name'][$a1], $directory1.$last_id1."_".$a1.".".$ext1); } $fileandpath1 = $directory1.$last_id1."_".$a1.".".$ext1; $pdo2 = Database::connect(); $pdo2->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql2 = "INSERT INTO agent (propertyid,agentimage) values(?, ?)"; $q2 = $pdo2->prepare($sql2); $q2->execute(array($last_id1,$fileandpath1)); Database::disconnect(); $a1++; } header("Location: admin_list.php"); } Here I have another code from my create page: <div class="control-group"> <label class="control-label">Contact Details:</label> <div class="controls"> <textarea name="contactdetails" type="text" placeholder="ContactDetails" cols="30" rows="10" value="<?php echo !empty($contactdetails)?$contactdetails:'';?>"></textarea> <?php if (!empty($contactdetailsError)): ?> <span class="help-inline"><?php echo $contactdetailsError;?></span> <?php endif;?> </div> </div> This code is for the images, the Agent Images is for the photo of the agent and there company logo: <div class="control-group"> <label class="control-label">Agent Images:</label> <div class="controls"> <input type="file" name="file[]" multiple><br /> </div> </div> This code is for the images of the properties: <div class="control-group"> <label class="control-label">Images:</label> <div class="controls"> <input type="file" name="file[]" multiple><br /> </div> </div> So the problem I am having is that I can't get the Agent Images to upload to the Agent directory and can't display it above my contact details, the screen shot image is in the attached, please help me. Everything works perfectly but I only need to get that images right for the Agents above the contact details.
  9. hi, I am using fixed-header code for my table on vertical scroll, its working fine for all column name except last two (balance and pay status) because they are going out side page (horizontally). and when i scroll from bottom to see the last two columns values , the fixed header only show the columns till advance, fixed header not showing last two remaining columns that go out side page horizontally. Check the screen shots for better understanding. image-1 you can see all column till pay status. [ATTACH=CONFIG]64973[/ATTACH] image -2 you can see vertical scroll working fine till advance column. [ATTACH=CONFIG]64974[/ATTACH] Image -3 but in this you can see after full horizontal scroll towards right side, it only showing column till advance, instead of balance and pay status. [ATTACH=CONFIG]64975[/ATTACH] Here is the full code Untitled Document $(document).ready(function() { function moveScroll(){ var scroll = $(window).scrollTop(); var anchor_top = $("#maintable").offset().top; var anchor_bottom = $("#bottom_anchor").offset().top; if (scroll>anchor_top && scroll Please check this and if found give me the solution for this. thanks in Advance
  10. Somewhat new with PHP but I think I'm on the right track. I'm trying to search for a serial number on a sql table. I want a response of the serial # and what column its in. There is 4 columns if that helps (id, 30, 32, 31). (serials 002062008002220 002062008002222 002062008002233 are in the table) When I enter in a serial # 002062008002220 (all serials are 16 digits long). I get a blank page to show up... my form <form action="search.php" method="get"> <input id="serials" type="text" name="serials" /> <input type="submit" /> </form> my php <?php $con=mysqli_connect("localhost", "xxx", "xxx", "nsmserials"); if (mysqli_connect_errno ()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $search = mysql_real_escape_string($_REQUEST['serials']); $query = "SELECT 30, 32, 31 FROM nsmtable WHERE 30 LIKE '%$search%' OR 32 LIKE '%$search%' OR 31 LIKE '%$search%'"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)){ echo "<li><span class='name'><b>{$row['serials']}</b></span></li>"; } mysqli_close($con); ?>
  11. for starters, i am a complete beginner at PHP, so i know almost nothing. so, the basic outline is that i am required to create a table with 2 columns, and use PHP where i can so the first set of code lays down the table and the ability to type in text of "name" and "surname". ----i think this "input" is HTML, yes?? is there a way to enter it as PHP? <table border=\"2\"> <tr><th><b>Requirements</b></th><th><b>Selections</b></th></tr> <tr><td>Name</td><td><input type="text" name="name"/></td></tr> <tr><td>Surname</td><td><input type="text" name="surname"/></td></tr> so, for this next section, adding on is the part for "age". i want this to appear as a dropdown selection. i've written PHP where possible, however this does not work when opening the file in a browser. it simply leaves a blank dropdown menu with no options. ???? <tr><td>Age</td><td><select> <?php for ($num=11; $num<=22; $num++){ echo '<option>' .$num. '</option>'; } ?> </select> lastly, i have the part for "activity choice". this again i believe i wrote the radio buttons in HTML??? am i able to write this as PHP???? <tr><td>Activity Choice</td><td><input type="radio" name="activityChoice" value "music"/> Music ($30.00)<br> <input type="radio" name="activityChoice" value "swimming"/> Swimming ($25.50)<br> <input type="radio" name="activityChoice" value "tennis"/> Tennis ($20.00)<br> <input type="radio" name="activityChoice" value "basketball"/> Basketball ($15.50)<br> <input type="radio" name="activityChoice" value "netball"/> Netball ($15.50)<br> <input type="radio" name="activityChoice" value "dance"/> Dance ($10.50)<br> <input type="radio" name="activityChoice" value "communityService"/> Community Service (No Charge)</td></tr> please please please help??
  12. so I am not the best coder, and have been having a really hard time getting this devision in javascript. I would put it in html, but I use javascript to clear the page <div id="test" style='position:fixed;bottom:0;left:0; height:76;background:darkorange;width:100%;'><h><object width="75" onclick="web()" height="75" data="img1.jpg"></object> <object width="75" onclick="mdoge()" height="75" data="img2.jpg"></object> <object width="75" onclick="word()" height="75" data="img3.jpg"></object></h></div> so that code above is the code I need to put in a document.write of something of equivalence. Is there any way to put this in javascript? thank you
  13. Good Day Guys I have a bit of a urgent problem. Here is my Query: $query = "SELECT distinct Img.propertyId as PropertyId, Title, ImageUrl, Location, Bedrooms, Bathrooms, Parking, Price FROM PROPERTIES as Prop LEFT JOIN IMAGES as Img ON Img.PropertyId = Prop.PropertyId WHERE 1=1 AND Price >=1000 AND Price <=5000 "; I have a problem and the problem is here - AND Price >=1000 AND Price <=5000. This works fine but the problem comes as soon as I add more: For example: if I add OR Price >5000 AND Price <=10000 then it displays all my results from 1000 to 10000 and I want it to be if I select 5000 - 10000 it needs to display only the results between 5000 and 10000. Can someone please help me?
  14. Here is my add driver button $( "#addDriver" ).button().click(function( event ) { event.preventDefault(); var dn = $("input[name=driver_name]").val(); var ds = $("input[name=driver_status]").val(); var dataString = 'driver_name='+ dn + '&driver_status='+ ds; //Here is where im trying to load it but it's not working $('#driversTable').jtable('load'); if(dn == '' || ds == '' ) { alert("Fill up all Fields with \'*\'"); } else { $.ajax({ type: "POST", url: "processDriver.php", data: dataString, dataType: "json", success: function(data){ if(!data.error && data.success) { alert(data.successMsg); $("input[name=driver_name]").val(''); $("input[name=driver_status]").val(''); } else { alert(data.errorMsg); } } }); } }); And here is my jTable init $("#driversTable").jtable({ title: 'Drivers', actions: { listAction: "getAllDrivers.php", }, fields: { did: { key: true, list: false }, dID: { title: 'Driver ID', width: '7%' }, dName: { title: 'Name', width: '7%' }, dStatus: { title: 'Status', width: '12%' } } }); $('#driversTable').jtable('load'); I want it to be right after adding a new record i want the table to refresh without refreshing the page. I tried the load and reload functions of jtable is not working or am i just putting them on the wrong place of my code?
  15. Hello I've got this form that keeps messing up. You can get to the link here: http://alexis-apparel.host56.com/ Attached below are all the files. I must have this done by the end of the month please help index.html html_form_send.php upload_file.php
  16. Here is my java script $.each(data, function() { var myTable1 = '<tr bgcolor=#ffffff>' + '<td align=center>'+this.vehiclelog_plate+'</td>' + '<td align=center>'+this.vehiclelog_name+'</td>' + '<td align=center>'+this.vehiclelog_date+'</td>' + '<td align=center>'+this.vehiclelog_reftype+'</td>' + '<td align=center>'+this.vehiclelog_refid+'</td>' + '<td align=center>'+this.vehiclelog_description+'</td>' + '</tr>'; $('#tableField').append(myTable1); }); And here is my HTML <div id="tabs-6"> <div id="rform"> <form action = "home.php" method="post"> <fieldset> <legend>View Vehicle Service</legend><br><br> <div> <label class="label-left">Vehicle Name:</label> <span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span> <input id="autocomplete" title="type "a"" class="ui-autocomplete-input" name="vehicle_service_search" autocomplete="off"> </div> <div> <button id="searchVehicleDesc" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" aria-disabled="false"> <span class="ui-button-text">View</span> </button> </div> <div> <table border="1" width="650" id = "tableField"> <tr bgcolor=#c0c0c0> <td width=100 align="center"><font face="helvetica"><b>Vehicle Name</b></font></td> <td width=80 align="center"><font face="helvetica"><b>Service Type</b></font></td> <td width=80 align="center"><font face="helvetica"><b>Others</b></font></td> <td width=100 align="center"><font face="helvetica"><b>Reference No.</b></font></td> <td width=80 align="center"><font face="helvetica"><b>Reference Date</b></font></td> <td width=80 align="center"><font face="helvetica"><b>Reference Type</b></font></td> </tr> </table> </div> </fieldset> </form> </div> </div> And here is my response [{"success":1,"plate":"SIX666","name":"YAMAHA ISUZU","date":"0000-00-00","type":"Add Vehicle","id":"0","desc":""},{"success":1,"plate":"VIE597","name":"Resource id #6","date":"2014-05-09","type":"OIL","id":"332142","desc":"castroil"}] Im getting the right response from ajax but I can't put my value to a table I get an alert that says undefined.
  17. I know how to implement ajax with php and get output with the help of java-script and ajax... Well, I am just trying to re-direct the page using ajax, but, it is not happening........ What I am doing is that after user logged-in successfully, the email and password are going to check by ajax and if the inputs are correct, the page must re-direct to another page... So, far I am able to verify the correct details, but, the page is not re-directing... You must also see that I want to re-direct the page with ajax only................I am able to redirect the page with java-script but I do not want to include re-direction with java-script in my website !! Thanks for helping me out !!
  18. good day guys i have a form name list topic like in codeacademy.com wherein you can choose a chapter like html,php ,etc then there is a sub lesson behind that button my question is how will i do that after i take finish the lesson and past the test the lesson will be wrap by a logo DONE / Finish my thesis proposal is computer aided instruction studentindex.php list.php
  19. Hello, I have written a code to use google map drawing tools to draw polygon, circle and point on the googlemap, i need to capture and store these drawing in my postgresql database and also be able to display the store data back on the map when queried. I need someone to look at my code and tell me how I can achieve this. The google map and the drawings functions well, i know i need to create a table in the database to capture the geometric information of the drawings which i have also done. but the table doesnt seem to be populating. i believe something is wrong with my code and i need help from anyone who has successfully done this in the past Thanks <?php $host = "host=localhost"; $port = "port=5432"; $dbname = "dbname=LS"; $credentials = "user=postgres password=carol74"; $db = pg_connect( "$host $port $dbname $credentials" ); if(!$db){ echo "Error : Unable to open database\n"; } else { echo "Opened database successfully\n"; } ?> <!DOCTYPE html> <head> <title>LSInfo Recording tool</title> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta charset="utf-8"> <style> html, body, #map { height: 90%; margin: 10px; padding: 0px } </style> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&libraries=drawing,geometry"></script> <script> var coordinates = []; var all_shapes = []; var selectedShape; function draw_shape() { for(var i = 0; i < all_shapes.length; i++) { all_shapes[i].setMap(null); } for(var i = 0; i < all_shapes.length; i++) { all_shapes[i].setMap(map); } } function clearSelection() { if(selectedShape) { selectedShape.setEditable(false); selectedShape = null; } } function setSelection(shape) { clearSelection(); selectedShape = shape; shape.setEditable(true); } function deleteSelectedShape() { if (selectedShape) { selectedShape.setMap(null); } } function save_coordinates_to_array(newShapeArg) { if(newShapeArg.type == google.maps.drawing.OverlayType.POLYGON) { var polygonBounds = newShapeArg.getPath(); for(var i = 0 ; i < polygonBounds.length ; i++) { coordinates.push(polygonBounds.getAt(i).lat(), polygonBounds.getAt(i).lng()); } } else { //alert("Not polygon");///////////// } } var map; function initialize() { map = new google.maps.Map(document.getElementById('map'), {zoom: 12, center: new google.maps.LatLng(7.07859, 5.64392)}); var drawingManager = new google.maps.drawing.DrawingManager(); drawingManager.setMap(map); google.maps.event.addListener(drawingManager, 'overlaycomplete', function(e) { var newShape = e.overlay; newShape.type = e.type; all_shapes.push(newShape); setSelection(newShape); save_coordinates_to_array(newShape); google.maps.event.addListener(newShape, 'click', function() {setSelection(newShape)}); }); google.maps.event.addListener(map, 'click', function(e) {clearSelection();}); } google.maps.event.addDomListener(window, 'load', initialize); </script> </head> <body> <h1>Property identifcation program</h1> <h2> Please Use the Tools shown on the map to markout your parcel location</h2> <div class="map" id="map-canvas"></div> <form method="post" action="" name="informarionForm" id="informarionForm" ><!--onsubmit="save_details(); return false;"--> <p><b></b> <table width="1100" cellpadding="10" cellspacing="0" border="1" align="center"> <tr align="center" valign="top"> <td align="center" colspan="1" rowspan="1" bgcolor="#FF8000"> <table style="width:80%" > <h3>sketch your property location on the Map!!</h3> <tr> Title_holder: <?php $sql =<<<EOF SELECT * from tblperson; EOF; $ret = pg_query($db, $sql); echo'<select name="Title_holder">'; while($row = pg_fetch_assoc($ret)){ echo "<option value=".$row["person_id"].">".$row["first_name"]."</option>"; //print_r($row); } echo '</select>'; ?> </tr> Title_Type: <?php $sql =<<<EOF SELECT * from ownership_type; EOF; $ret = pg_query($db, $sql); echo'<select name="Ownership" id="Ownership">'; while($row = pg_fetch_array($ret)){ $id = $row["type_id"]; if($id == $row["type_id"]){ echo 'selected'; } echo "<option value=".$row["type_id"].">".$row["type_description"]."</option>"; //print_r($row); } echo '</select>'; ?> </tr> <tr> Select boundary identifier: <?php $sql =<<<EOF SELECT * from boundaryidentificationtable; EOF; $ret = pg_query($db, $sql); echo'<select name="boundary_identifier">'; while($row = pg_fetch_array($ret)){ echo "<option value=".$row["boundary_id"].">".$row["boundary_type"]."</option>"; } echo '</select>'; ?> </tr> <tr> Media_Type: <?php $sql =<<<EOF SELECT * from lutmediatypes; EOF; $ret = pg_query($db, $sql); echo'<select name="lutmediatypes">'; while($row = pg_fetch_array($ret)){ echo "<option value=".$row["media_type_id"].">".$row["media_type"]."</option>"; } echo '</select>'; ?> </tr> <p></p> <tr> Select_Media: <?php $sql =<<<EOF SELECT * from tblmedia; EOF; $ret = pg_query($db, $sql); echo'<select name="tblmedia">'; while($row = pg_fetch_array($ret)){ echo "<option value=".$row["media_id"].">".$row["file_name"]."</option>"; } echo '</select>'; ?> <td>Capture boundaryline geometry from Map </td> <td><input name="the_geom2" type="text" id="the_geom2" ></td></td> </tr> <tr> <td>Capture Parcel Geometry from Map </td> <td><input name="the_geom" type="text" id="polygeom" ></td></td> </tr> <tr> <td>Add your description for this parcel:</td> <td><textarea cols="20" name="comments" rows="3" ></textarea></td> </tr> <td> </td> <td> <input name="Submit1" type="button" onclick="save_details();" value="Submit Information." ></td> </tr> </table> <p></p> <table width="700" cellpadding="10" cellspacing="0" border="1"> <tr align="center" valign="top"> <td align="center" colspan="1" rowspan="1" bgcolor="#CCCCCC"> <table style="width: 100%"> <h3>Identify other Useful Land resources and economic trees on your parcel</h3> <tr> Landuse:<?php $sql =<<<EOF SELECT * from landusetable; EOF; $ret = pg_query($db, $sql); echo'<select name="Landuse">'; while($row = pg_fetch_array($ret)){ echo "<option value=".$row["landuse_id"].">".$row["landuse_type"]."</option>"; } echo '</select>'; ?> </tr> <p></p> <tr> <td>Input Resource Name (tree; pond_water):</td> <td><textarea cols="20" name="comments" rows="3" ></textarea></td> </tr> <tr> Select media to upload(video, audio, picture or text): <?php $sql =<<<EOF SELECT * from tblmedia; EOF; $ret = pg_query($db, $sql); echo'<select name="tblmedia">'; while($row = pg_fetch_array($ret)){ echo "<option value=".$row["media_id"].">".$row["file_name"]."</option>"; } echo '</select>'; ?> <tr> <td>Preview Media(video, audio, picture or text)</td> <td><input name="previewVideo" type="text"></td> </tr> <tr> <td> </td> <td> <input name="Submit1" type="button" onclick="save_details();" value="Submit Information." ></td> </tr> </table> </form> </body> </html>
  20. Hi all, I hope you can help me further with this problem. I want to build a quiz/votematch website like this one: http://bit.ly/1kGUGJ6 I want to ask about 20 questions and record all clicked items, so I can use it to match it after the last question. All questions are like this: <div class="stelling" id="stelling4618"> <p>Question 1</p> <h2>The question here.</h2> <a address="true" href="#/stelling/2" class="big botshadow button agree">Eens</a> <a address="true" href="#/stelling/2" class="big botshadow button neutral">Geen van beide</a> <a address="true" href="#/stelling/2" class="big botshadow button disagree">Oneens</a> <a address="true" href="#/stelling/2" class="medium button skip">Sla deze vraag over</a> </div> So if a user click on the first link, <a>eens</a>, I want to push this text to an array with php. After question 20 I want to show all clicked items and match it with my database values. How can I do this? Please help me, I really need this... Thanks so much!! Kind regards, Mark
  21. Here is my button $( "#editVehicle" ).button().click(function( event ) { event.preventDefault(); var vp = $("input[name=vehicle_plate]").val(), dataString = 'vehicle_plate='+ vp; $.ajax({ type: "POST", url: "editvehicle.php", data: dataString, dataType: "json", success: function(data){ if(!data.error && data.success) { $("input[name=vehicle_model]").val(data.vehicleName); $("input[name=assigned_driver]").val(data.assignedDriver); } else { alert(data.errorMsg); } } }); }); And here is my PHP <?PHP include("db.classes.php"); $g = new DB(); $g->connection(); if($_POST) { $vehiclePlate = $g->clean($_POST["vehicle_plate"],1); $g->edit($vehiclePlate); } $g->close(); ?> and here is my db.classes public function edit($vehiclePlate) { $sql = "select vehicle_name, driver_id from vehicles where vehicle_plate='$vehiclePlate'"; $result = mysql_query($sql) or die(json_encode(array("error" => 0, "errorMsg" => "MySQL query failed."))); $row = mysql_fetch_array($result); if(mysql_num_rows($row)) { echo json_encode(array( "success" => 1, "vehicleName" => $row['vehicle_name'], "assignedDriver" => $row['driver_id'] )); } else { echo json_encode(array( "error" => 1, "errorMsg" => "No rows returned" )); } } There is an input field in my html where i input the vehicle plate then when the user clicks the button the program searches the database for the vehicle name and driver_id with the plate the user entered and returns the value to another inputfield named "vehicle_name" and "assigned_driver" but nothing is happening when the button is clicked not even the error alert message. Any idea on where am i going wrong here?
  22. I am looking for a script to make a photo gallery exactly like the one iTunes uses. This is what it looks like: I want all of the same functionalities as this one has and I need to be able to put it inside of a web page easily and sized the way I will need it. The images displayed in this gallery must auto-resize and open in a new tab as the original file when clicked on. I need the iPhone and iPad screen view options to both be there and if there aren't any images for one or the other, the button to switch isn't displayed or is inactive. If you could write this script or give me source code, that'd be great as I really need it for my new site I am developing. Please make it look exactly the same
  23. Hey guys! Fairly new with PHP/MySQL and been working on a website for a class, and having some issues with my drop down not working as intended. What I'm trying to do is simply allow the user to select a name from a drop down field, then after pressing the submit button, would delete the selected name from the database. Here is my code. <?php ini_set('display_errors', 'on'); error_reporting(E_ALL); session_start(); $_SESSION['title'] = "PEC Menu"; //Opening Session Vars $currentFile = $_SERVER["PHP_SELF"]; //current page for menu $currentUser = $_SESSION['currentname']; // users account info include('../../functions/mainmenu.php'); // menu functions //Menu Content,Code / Buttons Goes here DrawMenu($currentFile, $currentUser); //Setting up database mysql_connect("localhost","root","changeme"); mysql_select_db("certestdb"); $dbLink = mysql_connect("localhost", "root", "changeme"); mysql_query("SET character_set_client=utf8", $dbLink); mysql_query("SET character_set_connection=utf8", $dbLink); $result = mysql_query("SELECT distinct TermID FROM clinical") or die(mysql_error()); $result2 = mysql_query("SELECT FullName FROM useraccess") or die(mysql_error()); $options=''; $options2=''; while($row=mysql_fetch_array($result)) { if (isset($_POST)) { $TermID=$row["TermID"]; $options.= '<option value="'.$row['TermID'].'">'.$row['TermID'].'</option>'; } }; while($row=mysql_fetch_array($result2)) { if (isset($_POST)) { $FullName=$row["FullName"]; $options2.= '<option value="'.$row['FullName'].'">'.$row['FullName'].'</option>'; } }; if (isset($_POST)) { mysql_query("DELETE FROM useraccess WHERE FullName='$FullName'") or die(mysql_error()); echo "Success!"; } else { echo "Not successful"; } ?> <html> <style> </style> <body> <h4> Add User</h4> <form name = "AddUser" action="PEC_addUser.php" method= "get" style = "text-align:right; color: Black;float:left;"> <input type="submit" value="Add User"> </form><br><br> <hr size = "5" color = "darkgray"> <h4> Assign User to Course</h4> <form name = "AssignUser" action=" " method= "get" style = "text-align:right; float:left; color: darkred;"> User: <select> </select> Course: <select> </select> Term: <SELECT NAME= termid> <OPTION VALUE=0>Choose</OPTION> <?php echo $options; ?> </select> <input type="submit" value="Assign"> </form> <br><br> <hr size = "5" color = "darkgray"> <h4> Assign Student to Instructor </h4> <form name = "AssignStudent" action=" " method= "get" style = "text-align:right; color: darkred;float:left;"> Student: <select> <option value = "Select"> Select</option>} <option value = "one"> 1</option>} <option value = "two"> 2</option>} <option value = "three"> 3</option>} </select> Course: <select> <option value = "Select"> Select</option>} <option value = "one"> 1</option>} <option value = "two"> 2</option>} <option value = "three"> 3</option>} </select> Instructor: <select> <option value = "Select"> Select</option>} <option value = "one"> 1</option>} <option value = "two"> 2</option>} <option value = "three"> 3</option>} </select> <input type="submit" value="Assign"> </form><br><br> <hr size = "5" color = "darkgray"> <h4> Delete User</h4> <form name = "DeleteUser" action=" " method= "get" style = "text-align:right; color: darkred;float:left;"> User: <SELECT NAME= FullName> <OPTION VALUE=0>Choose</OPTION> <?php echo $options2; ?> </select> <input type="submit" name="delete" value="delete"> </form><br><br> <hr size = "5" color = "darkgray"> <link rel="stylesheet" href="styles/pecui.css" media="screen" /> </body> </html> <?php ?> This is where the possible issue is if (isset($_POST)) { mysql_query("DELETE FROM useraccess WHERE FullName='$FullName'") or die(mysql_error()); echo "Success!"; } else { echo "Not successful"; } What happens is upon submitting, it just deletes the last 2 records in the table "useraccess" instead of the value selected from the drop down. I'm thinking that its not properly storing the data from the database, which is whats causing the query issue. If anyone could help me, it would be very much appreciated it.
  24. This code is giving me one warning and it is not functioning as it should . Files are below.i have following problems in this code and i dont know where am i doing wrong.i am confused:( . 1. Warning: implode(): Invalid arguments passed in \upload_new\upload.php on line 11 2. it doesnot check the empty fields and upload the image .if i select image only and press upload , it uploads image and dont check for empty fields. 3.i want to display the submitted code , but it doesnot displays. upload.php <?php //session session_start(); $errorPrint = ''; if(isset($_SESSION['form_upload']['errors']) && $_SESSION['form_upload']['errors']) { $errorPrint = $_SESSION['form_upload']['errors']; unset($_SESSION['form_upload']['errors']); } echo implode("<br />",$errorPrint); ?> <!DOCTYPE HTML> <html> <head> <title>Upload Image form</title> </head> <body> <form action="formhandler.php" method="post" enctype="multipart/form-data"> <br><br> Image Title: <input type="text" name="imagetitle" ><br><br> <input type="hidden" name="MAX_FILE_SIZE" value="2000000"> <input type="file" name="userfile" id="userfile" ><br><br> Choose Date: <input type="date" name="pickdate" > <br><br> <input id="button_1" type="radio" name="option" value="button1" /><label for="button_1" >Button 1</label> <input id="button_2" type="radio" name="option" value="button2" /><label for="button_2" >Button 2</label><br><br> <select name="list1"> <option value="">Select Options</option> <option value="option1">Option 1</option> <option value="option2">Option 2</option> <option value="option3">Option 3</option> </select> <br><br> <select name="list2"> <option value="">Select Type</option> <option value="type1">Option 1</option> <option value="type2">Option 2</option> <option value="type3">Option 3</option> </select> <br><br> <input name="upload" type="submit" class="box" id="upload" value=" Upload " > </form> </body> </html> formhandler.php <?php //session session_start(); $_SESSION['form_upload']['errors'] = NULL; $description=$fileSize=$filename=$date=""; if (isset($_POST['upload'])) { if ($_FILES['userfile']['size'] > 0) { echo '<pre>'; // to get this work delete exit function at the bottom print_r($_POST); echo '</pre>'; $allowed_filetypes = array( '.jpg', '.jpeg', '.png', '.gif' ); $max_filesize = 1445760; $description = $_POST['imagetitle']; $filename = $_FILES['userfile']['name']; $ext = substr($filename, strpos($filename, '.'), strlen($filename) - 1); if (!in_array($ext, $allowed_filetypes)) die('The file you attempted to upload is not allowed.'); if (filesize($_FILES['userfile']['tmp_name']) > $max_filesize) die('The file you attempted to upload is too large.'); $fileName = $_FILES['userfile']['name']; $tmpName = $_FILES['userfile']['tmp_name']; $fileSize = $_FILES['userfile']['size']; $fileType = $_FILES['userfile']['type']; $date= $_POST['pickdate']; $fp = fopen($tmpName, 'r'); $content = fread($fp, filesize($tmpName)); $content = addslashes($content); fclose($fp); if (!get_magic_quotes_gpc()) { $fileName = addslashes($fileName); } //!get_magic_quotes_gpc() include 'config.php'; include 'opendb.php'; $query = "INSERT INTO upload (name, size, type, content ,date,description ) " . "VALUES ('$fileName', '$fileSize', '$fileType', '$content', '$date','$description')"; mysql_query($query) or die('Error, query failed'); include 'closedb.php'; echo "<br>File $fileName uploaded<br>"; }//isset($_POST['upload']) && $_FILES['userfile']['size'] > 0 else { echo 'Please Upload an Image.'; } } //isset($_POST['upload']) echo "<h2>Your Input:</h2>"; echo "Title =".$description; echo "<br>"; echo "Filename =".$filename; echo "<br>"; echo "File size =".$fileSize; echo "<br>"; echo "Date =".$date; if($errors) $_SESSION['form_upload']['errors'] = $errors; header('Location: upload.php'); exit; ?>
  25. here is my insert method public function add($values) { $sql = "insert into vehicles(`vehicle_plates`,`DA`,`type`, `model`, `driver`) values('$values')"; if(!mysql_query($sql)) { $this->error = mysql_error(); return true; } else { return false; } } And here is my Button click funtion $( "#button" ).button(); $( "#button" ).click(function( event ) { <?PHP if(isset($_POST["subBtn"])) { $fName = $g->clean($_POST["fullname"],1); $sDate = date('Y-m-d', strtotime($_POST["startdate"])); $roomNum = $g->clean($_POST["roomnumber"]); $driver = $g->clean($_POST["driver"],1); $model = $g->clean($_POST["model"],1); $json = '{"a":$fName, "b":$sDate, "c":$roomNum, "d":$model, "e":$driver}'; $array = json_decode($json, true); $values = implode(",", $array); $g->add($values); } ?> }); Everytime i click my button it Postsback and nothing inserts in my database...
×
×
  • 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.