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. hi, i need some help, in mysql query the output show as below :- 020000000000000000000790715035426 FIRSTNAME LASTNAME 800 000000000015900000000000013500000000000121700 but when i do <?php $data1 = mysql_query("SELECT * FROM details_view WHERE hashtotal = '$id'") or die(mysql_error()); while($info1 = mysql_fetch_array( $data1 )) { print $info1['details']; } ; ?> the output is :- 020000000000000000000790715035426 FIRSTNAME LASTNAME 800 000000000015900000000000013500000000000121700 How to make the php query same character length as mysql query? thank you.
  2. Hi all , I'm new to php. I'm trying to scrape the soccer website (http://www.soccerladuma.co.za/leagues/tables) the league tables on it , i have tried to get the element by it and tag name but i'm getting a blank screen.I only get the whole page if when i remove my tag name n tag id code. Please help , see code below that gets the page and plz lead me to how to get that specific league table from this site. <?php $url = "http://www.soccerladuma.co.za/leagues/tables"; // Create a stream so that we can set a User-Agent $opts = array( 'http'=>array( 'method'=>"GET", 'header'=>"Accept-language: en\r\n" . "Cookie: foo=bar\r\n" . "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.107 Safari/534.13\r\n" ) ); $context = stream_context_create($opts); $str = file_get_contents($url, false, $context); $str = strip_tags($str,"<style>"); $substring = substr($str,strpos($str,"<style"),strpos($str,"</style>")+2); $dom = new DOMDocument(); $dom ->loadHTML($str); //@ is puted to prevent html warnings $xpath = new DOMXPath($dom); echo "<pre>"; print_r($dom->textContent); echo "<pre>"; ?
  3. Guys, need some help.. Right now i have a login page with select box option.. I have create several other page (admin_page.php, student_page.php, parents_page.php) to link with the option in the select box.. So what im asking now is how to link the selected option to their page respectively with the username and pass correct? Here is the login page looks like.. http://i272.photobucket.com/albums/jj178/r1nk_2008/lol_zpsa54db359.png <html> <head> <title> Login Form </title> </head> <body> <div style="width: 200px; margin: 200px auto 0 auto;"> <form method='post' action='login.php'> <table width='400' border='5' align='center'> <tr> <td align='center' colspan='5'><h1>Member Login</h1></td> </tr> <tr> <td align='center'>Username:</td> <td><input type='text' name='username' /></td> </tr> <tr> <td align='center'>Password:</td> <td><input type='password' name='pass' /></td> </tr> <tr> <td></td> <td align='left'> <select name="type" id="type"> <option value="0" selected="selected">Select user type</option> <option value="admin">Admin</option> <option value="student">Student</option> <option value="lecturer">Lecturer</option> <option value="parents">Parents</option> </select> </td> </tr> <tr> <td colspan='5' align='center'><input type='submit' name='login' value='Log In' /></td> </tr> </table> </form> </body> </html> <?php mysql_connect("localhost","root",""); mysql_select_db("student_attendance"); if(isset($_POST['login'])){ $username = $_POST['username']; $password = $_POST['pass']; $type = $_POST['type']; $check_user = "select * from users where username='$username' AND pass='$password' AND type='$type'"; $run = mysql_query($check_user); if(mysql_num_rows($run)>0){ echo "<script>window.open('admin_page.php','_self')</script>"; } else { echo "<script>alert('Username, password or user type is incorrect!')</script>"; } } ?>
  4. Hi there, I am not sure whether this is an issue you can help with or point me in the right direction? I have a wordpress theme with US $. Currency, Trying to change it to GBP £. Theme providers cant help unless I use a one of their own themes. http://www.lettingagentsbournemouth.co.uk/residential-lets/#/1830722466 Mant thanks in advancer. K
  5. Hey, i got another question. Ok so far i have a table called users (id, name, username, pass, type) and here is my coding so far.. <html> <head> <title> Login Form </title> </head> <body> <form method='post' action='login.php'> <table width='400' border='5' align='center'> <tr> <td align='center' colspan='5'><h1>Login Form</h1></td> </tr> <tr> <td align='center'>Username:</td> <td><input type='text' name='username' /></td> </tr> <tr> <td align='center'>Password:</td> <td><input type='password' name='pass' /></td> </tr> <tr> <td align='center'> <select name="type" id="type"> <option value="0 selected="selected">Select user type</option> <option value="admin">Admin</option> <option value="student">Student</option> </select> </tr> <tr> <td colspan='5' align='center'><input type='submit' name='login' value='Log In' /></td> </tr> </table> </form> </body> </html> <?php mysql_connect("localhost","root",""); mysql_select_db("student_attendance"); if(isset($_POST['login'])){ $username = $_POST['username']; $password = $_POST['pass']; $type = $_POST['type']; $check_user = "select * from users where username='$username', pass='$password' AND type='$type'"; $run = mysql_query($check_user); if(mysql_num_rows($run)>0){ echo "<script>alert('You are logged in')</script>"; } else { echo "<script>alert('username,password or user type is incorrect!')</script>"; } } ?> And when i viewed it looks like this.. http://i272.photobucket.com/albums/jj178/r1nk_2008/prob_zpsd907ed84.png So my questions are :- -how to make the select box option to the right side, below the password form ? -how to fix the error so that when i enter correct username, pass and type it says "you are login" ?
  6. my code below works perfect in Mozilla and Chrome but not in IE8, when i select a Radio button in IE its showing other options for other Radio button, need help in fixing the issue in IE8 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript" charset="utf-8"></script> <script src="jquery.chained.js" type="text/javascript" charset="utf-8"></script> <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script> <link rel="stylesheet" href="style.css" /> <script type="text/javascript" src="infratool.js"></script> <script> $(function() { $("#submit").hide(); $("#Category").change(function() { window.location = $(this).val().split(" ")[0]; if(loc) window.location.href = loc; }) }); </script> <table width="392" border="0"> <td colspan="2" align="center"><form id="form1" name="form1" method="post" action=""> <tr> <td align="center"> <label><input name="Radio1" type="radio" id="TestA" value="TestA" onclick="showSelect();" />TestA</label> <label><input name="Radio1" type="radio" id="TestB" value="TestB" onclick="showSelect();" />TestB</label> </td> </tr> </form> <div id="div-id" align="center"><select name="Category" id="Category" class="hide"> <option value=" TestA TestB" selected="selected">--</option> <option value="TestA1.php TestA">TestA1</option> <option value="TestA2.php TestA">TestA2</option> <option value="TestA3.php TestA">TestA3</option> <option value="TestA4.php TestA">TestA4</option> <option value="TestA5.php TestA">TestA5</option> <option value="TestB1.php TestB">TestB1</option> <option value="TestB2.php TestB">TestB2</option> <option value="TestB3.php TestB">TestB3</option> <option value="TestB4.php TestB">TestB4</option> <option value="TestB5.php TestB">TestB5</option> <option value="TestB6.php TestB">TestB6</option> </select><input type="submit" value="Go" id="submit"/> </div> </table> here are the other java scripts ive been using //Show Select option after clicking Radio button: function showSelect() { var select = document.getElementById('Category'); select.className = 'show'; } //Select option, separates the link from Class $(function(){ var select = $('#Category'), options = select.find('option'); $('[type="radio"]').click(function(){ var visibleItems = options.filter('[value*="' + $(this).val() + '"]').show(); options.not(visibleItems).hide(); if(visibleItems.length > 0) { select.val(visibleItems.eq(0).val()); } }); }); $(function() { $("#submit").hide(); $("#Category").change(function() { window.location = $(this).val().split(" ")[0]; if(loc) window.location.href = loc; }) }); and here is the screenshot in Firefox and IE8 respectively.
  7. Hey, I want to list all of my database entries to a nice html format. For every unique id there is one row displayed out from my database to my php/html. I just don't know how to do that. I tried using while loop and foreach I just don't know how to properly structure them... My query and php code looks like this: $query = mysql_query("SELECT * FROM sport"); while($row = mysql_fetch_array($query)) { $result = $row['sport_ime'].' '.$row['sezona']; }
  8. Please help make this? ALL LINES FROM EACH OF THE 4 TEXT FILES MUST MATCH, SO IN FACT IF ALL IS READING LINE 3 FROM STARTING HTML THEN IT WILL IN FACT CHANGE BASED ON THE INFO FROM LINE 3 FROM THE OTHER TEXT FILE. ALL LINES MUST MATCH TO CREATE A CHANGE PAGE AND GIVE THE LOCATION OF THE NEW PAGE. There will be four TXT files (1) ChangeThisHtml.txt <p>SUPERBASE</p> <p>SUPERBASE</p> <p>SUPERBASE</p> <p>SUPERBASE</p> <p>SUPERBASE</p> <p>SUPERBASE</p> <p>SUPERBASE</p> <p>SUPERBASE</p> <p>SUPERBASE</p> <p>SUPERBASE</p> (2) EndingHtmlLocation.txt D:\index1.html D:\index2.html D:\index3.html D:\index4.html D:\index5.html D:\index6.html D:\index7.html D:\index8.html D:\index9.html D:\index10.html (3) StartingHtml.txt <p>SUPERNATURAL </p> <p>SUPERNATURAL1 </p> <p>SUPERNATURAL2 </p> <p>SUPERNATURAL3 </p> <p>SUPERNATURAL4 </p> <p>SUPERNATURAL5 </p> <p>SUPERNATURAL6 </p> <p>SUPERNATURAL7 </p> <p>SUPERNATURAL8 </p> <p>SUPERNATURAL9 </p> (4) StartingHtmlLocation.txt D:\index.html D:\index.html D:\index.html D:\index.html D:\index.html D:\index.html D:\index.html D:\index.html D:\index.html D:\index.html HTML FILE <html> <head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>SUPERBASE</title> </head> <body> <p>SUPERBASE</p> </body> </html> pages1.zip
  9. I am trying to update 3 images of same product_id. I have a different product_table and Product_images table. The product_images table has 5 fields; image_id, product_id, name, images, ord. I am trying to update images for any specific product_id. The problem I was facing before was that it set the same 'Image' for all of the three 'images', that why I add 'ord' filed and it solver that problem. Now I have a new problem. I am unable to understand where to write update image' query. If I write it inside for loop then it runs 'Update Query' 6 times and if I write it outside for loop then its unable to find out $ord[] variable. Kindly tell the way to resolve this problem. Given below is the part of code I am working on. /* * ------------------- IMAGE-QUERY Test 002 -------------------- */ if (isset ( $_FILES ['files'] ) || ($_FILES ["files"] ["type"] == "image/jpeg")) { $i = 1; /* * ----------------------- Taking Current Order_id ------------------------ */ // $order_sql= "select MAX(ord) from product_images"; $order_sql = "SELECT ord from product_images where product_id=$id"; $order_sql_run = mysql_query ( $order_sql ); echo mysql_error (); for($i = 1; $i <= $order_fetch = mysql_fetch_array ( $order_sql_run ); $i ++) // while ($order_fetch= mysql_fetch_array($order_sql_run)) {) echo 'ID ' . $order_id [$i] = $order_fetch [(ord)]; } /* * ----------------------- Taking Current Order_id ------------------------ */ foreach ( $_FILES ['files'] ['tmp_name'] as $key => $tmp_name ) { // echo $tmp_name."<br>"; // echo 'number<br>'; echo $image_name = $_FILES ["files"] ["name"] [$key]; $random_name = rand () . $_FILES ["files"] ["name"] [$key]; $folder = "upload/products/" . $random_name; move_uploaded_file ( $_FILES ["files"] ["tmp_name"] [$key], "upload/products/" . $random_name ); echo '<br>'; echo $sql = "update product_images set name= '$random_name',images= '$folder' where product_id=$id andord=$order_id[$i]"; if ($query_run = mysql_query ( $sql )) { echo '<br>'; echo 'Done'; } else { echo mysql_error (); } // $i=$i+1; } } /*------------------- IMAGE-QUERY Test 002 --------------------*/
  10. RewriteRule ^([^/]*)\.html$ random.php?id=$1 [L] Any link to a file in the folder will be Rewritten as above. example: www.url.com/cat.html becomes: www.url.com/random.php?id=cat How can I make a link ignored so a html file in the folder can be opened?
  11. We have a website with around 1k pages inside it. They all end in .html.. We spent about a year marketing and advertising specific pages of our website all over the net. We are in a process of updating our website, and wish to implement blogs(wordpress) and other useful tools like comments, ratings, etc.. Many of these scripts(widgets) require that the page end in .php in order to make these scripts work. I am trying to keep everything consistent to our advertisement. My question is, is it possible to rename all .HTML files to .PHP and still keep the advertising links? Without having to go to all of our advertising pages and change links..? If so, what would this process be called.. I heard of sync linking and meta refresh, but not sure if this is what we need.
  12. Hello I have written the following code to update Images that are stored in Files. The code is working perfectly when I am using it to Upload images, but when I use it to Update Images, it is giving me 'Invalid file' error message. It is getting problem in the first 'if' statement and directly going to its else statement message 'Invalid File'. Kindly check it and guide me. Thanks <?php var_dump($_REQUEST); session_start(); error_reporting(E_PARSE); if (isset ($_SESSION['username']) ) { //echo "<div id='nav'"; echo "<ul><hr> <li><a href='insert_product.php' >Add Product | </a></li> <li><a href='add_category.php'> Add Category </a></li> <li><a href='sub_categories.php'> Add Sub-Category </a></li> <li><a href = 'view_products.php' >View All Products</a> </li> <li><a href = 'all_categories.php' >View All Categories</a> </li> <li><a href='view_all_sub_categories.php'>View All Sub Categories</a></li> </ul></hr>"; include 'connect.php'; $category_id= $_GET['category_id']; $query= "select * from category where category_id= $category_id"; $query_run= mysql_query($query); $fetch= mysql_fetch_array($query_run); $name= $fetch['name']; echo " <form action='update_category.php?category_id=$category_id' method='POST' > <table border=1> <tr><td> Category Name:</td><td><input type='text' name='category' value='$name' /> </td></tr> <tr><td> Image1:</td><td> <input type='file' name= 'image' > </td></tr> <tr><td> <input type='submit' value='Update' /> </td></tr> </form> </table> "; echo "<form action='delete_category.php?category_id=$category_id' method='POST'> <input type='submit' value='Delete'> </form> "; if (isset($_POST['category']) ) { $category_name = $_POST['category']; $query_update="UPDATE category SET name = '$category_name' WHERE category_id =$category_id "; if (mysql_query($query_update)) { echo "Records updated"; } else { echo mysql_error(); } /*------------------- IMAGE QUERY --------------------*/ $allowedExts = array("gif", "jpeg", "jpg", "png"); $extension = end(explode(".", $_FILES["image"]["name"])); if ((($_FILES["image"]["type"] == "image/gif") || ($_FILES["image"]["type"] == "image/jpeg") || ($_FILES["image"]["type"] == "image/jpg") || ($_FILES["image"]["type"] == "image/pjpeg") || ($_FILES["image"]["type"] == "image/x-png") || ($_FILES["image"]["type"] == "image/png")) //&& ($_FILES["file"]["size"] < 200000) && in_array($extension, $allowedExts)) { if ($_FILES["image"]["error"] > 0) { echo "Return Code: " . $_FILES["image"]["error"] . "<br>"; } else { echo "Upload: " . $_FILES["image"]["name"] . "<br>"; echo "Type: " . $_FILES["image"]["type"] . "<br>"; echo "Size: " . ($_FILES["image"]["size"] / 200000) . " kB<br>"; $image_name= $_FILES["image"]["name"]; $random_name= rand().$_FILES["image"]["name"]; $path= move_uploaded_file($_FILES["image"]["tmp_name"], "upload/categories/" . $random_name); $folder="upload/categories/" .$random_name; echo "Stored in: "."upload/categories/". $random_name; echo $sql= "update category_images set name='$image_name' , location='$folder' where category_id= $category_id "; $result = mysql_query($sql); if ($result) { echo "successfull"; } else { echo mysql_error(); } } } else { echo "Invalid file". $_FILES["image"]["error"]; } /*----------------- IMAGE QUERY END ------------------*/ } /* echo $sql= "update category_images set name='$image_name' , location='$folder' where category_id= $category_id "; */ } else { echo "You Must need to Log in to Visit this Page"; } ?>
  13. I am curious about server access. Lets say you buy a hosting service, can you manually decide which directories will be public and which will be off limits? Do public directories have to include views (templates)? Because in a lot of frameworks I see views in private directories. Can you block access via .htaccess and only allow users to browse certain pages? How do you prevent them from browsing your entire php app files? I know this is a lot of question but a simple overview about directory structure in apache servers will do, since I am building one.
  14. Hey, I was asking a lot of questions lately on this forum and it all boiled down to this one. We all know it is hype to implement front controller or master page index.php that handles all the requests to all the pages and reroutes you etc... All this for cleaner urls, easier code handling... But what if you have a browser game with a lot of locations and variables, states, conditions etc.. I can't write a million if statements or switch statements on my index page. What if I implement such page structure as described below? Basicly you don't have single point of entry or one front controller but more main controllers that connect to subcontrollers: if location forest if loged in |---------------------------- forest.php |------------------ start.php -------------| | | if location home | |-------------------------- homebase.php | | | | if location else index.php---------| |------------------------- anywhere.php | | if in fight |------------------- combat.php | | if not loged in |------------------- homepage.php Why would all pages have to go through index.php? This would be a big mess! Divide pages based on location, for example my start.php page will decide where to redirect further. So in this case I have two bigger controllers not just one front one. Is this still a good convention? I mean is this still a good front controll design or is it better to leave all the redirects to index.php?
  15. Hi all, I have a page with 3 comboboxes. After selecting options from the three. Onclick of the submit button I would like for an image to load in dynamically for that selection. What would the easiest and best way to implement such a feature ? Any help would be much appreciated ?
  16. I know some people make a single point of entry to their website which is usually index.php - the first site you visit and login from. But what is this exactly? Is it a controller that decides which webpages to show like in this tutorial http://www.technotaste.com/blog/simple-php-front-controller/ ? Why would you want a controller for a whole page? How does it work? Does it just redirect every link you click to the index.php and every header in php leads to index.php? In the provided tutorial, author goes on how we type the url and it redirects us to index.php. But what does this mean in reality, when you must click links and forms to navigate through a website? Does this mean that every submitted form and every new php page redirects to controller page and then the controller page redirects everything to index.php?
  17. Hi all, I would like to create a function that allows two options to be selected and then on pressing submit it loads in content dynamically. How can I create such a feature ? Any help would be much appreciated
  18. Hi all, I really need some help on this one. I've created a very complex page with a number of buttons that load content in dynamically. (There are quite a few combinations) What I would like to know is, is there a way to hard-code if an option is selected on one page that that selection stay open on another page ? For example I'm on the globe.html page having selected option 3. I open the view.html page and that page starts on option 3 due to it being selected on the previous page. Any help would be very appreciated
  19. Hello all, Im working on a back-end system that sends push notifications. At the moment on click of send button the loading gif appears underneath. I would like the send button to disappear and for the loading gif to appear as it is now. How can I implement this feature ? Any help would be much appreciated <div class="row-fluid"> <input type="submit" name="badgeSubmit" class="span5 offset7 blue-button" value="Send" onClick='return checkvalue() && toggle(); return false;' /> <img style="position:relative; top:20px;"src="/images/sending.gif" alt="loading" class="sending"> </div>
  20. Not sure how to go about this task but I imagine it requires some sort of foreach loop I have a drop down list populated by a label called LST_Type, this table only exists to provide options for this dropdown list The value selected on the dropdown menu gets written to a table called "assets". when the users clicks away from the form (using ajax) Here is what I need to happen: On page load the dropdown list need its default option to be whatever the current value of the record is in the "asset" table. As the only way you can insert data into this field is via the dropdown list it will always be somethig from the "LST_Type" table The reason is that the data is written to the fields when you click away from the input boxes and unless you are editing the "Type" record it updates it to its default selection. hope this makes sense here is my code: <tr id="<?php echo $id; ?>" class="edit_tr"> <!-- Title Colum --><td class="style4" style="font-size:14px;width:200; height:35px; class="edit_td"> Type: </td> <td style="font-size:14px;width:270px;border:solid 0px #000;padding:0px; class="edit_td"> <span style="color:#0066CC;" id="type1_<?php echo $id; ?>" class="text"><?php echo $Type; ?></span> <!-- ***************************************START - This Is the dropdown menu script *********************************************** --> <script type="text/javascript"> function OnDropDownChange2(dropDown) { var selectedValue = dropDown.options[dropDown.selectedIndex].value; document.getElementById("type1_input_<?php echo $id; ?>").value = selectedValue; } </script> <select name = "MYtype" id="type1_input_<?php echo $id; ?>" class="editbox" onChange="OnDropDownChange2(this);">> <?php $sql = mysql_query("SELECT Type FROM LST_Type"); while ($row = mysql_fetch_array($sql)){ echo "<option value='" . $row['Type'] . "'>" . $row['Type'] . "</option>"; } ?> </select> <input type="text" value="<?php echo $Type; ?>" class="editbox" id="type1_input_<?php echo $id; ?>" /> /> <!-- ***************************************END *********************************************** -->
  21. Hello everybody, I'm working on a back-end system where WordPress is brought in using an iFrame. The iFrame itself is responsive but the editor within the iFrame that wordpress is bringing in isn't responsive. What I'm trying to achieve is an editor (WYSIWYG) that will be responsive for mobile device's. How can I implement an editor that will fulfill these requirements? I'm fairly new to Wordpress but I've worked with PHP and WYSIWYG editors before. I want it to be a safe operation of changing over the editors so that I don't break anything in the application. Any replies and advice would be greatly appreciated Adam
  22. Hey PHP coders, Having trouble with a small application here. I copy/pasted 4 files below. My connect.php (Is the database connection with username, password, etc), index.html (file used to get user information for upload --- its a form that (redirects to create_user.php), create_user.php (my sql statements to upload the form into the database, show_user.php (redirected from create_user.php that should be populated with user information and should show up [however it does not]. WHAT AM I DOING WRONG HERE?????? PLEASE LET ME KNOW. THANKS IN ADVANCE. I AM USING LOCALHOST.. __________________________________________________ CONNECT.PHP: __________________________________________________________________ <?php $database_host = "localhost"; $username = "php1"; $password = "jack"; $database_name = "user"; //require_once 'app_config.php'; mysql_connect($database_host, $username, $password) or die ("<p>Error connecting to database: " . mysql_error() . "</p>"); header("Location: show_user.php?user_id=" . mysql_insert_id()); // exit(); //echo "<p>Connected to MySql!!!!!</p>"; mysql_select_db($database_name) or die("<p>Error selecting the database user: " . mysql_error() . "</p>"); exit(); //echo "<p>Connected to Mysql, using database USER.</p>"; /* $result = mysql_query("SHOW DATABASES;"); if (!$result) { die("<p>Error in listing tables: ". mysql_error() . "</p>"); } echo "<p>Table in database:</p>"; echo "<ul>"; while ($row = mysql_fetch_row($result)) { echo "<li>Table: {$row[0]}<li>"; } echo "</ul>" */ ?> ____________________________________________________________________________ CREATE_USER.PHP __________________________________________________________________________________________________ <?php require_once 'connect.php'; $first_name = trim($_REQUEST['first_name']); $last_name = trim($_REQUEST['last_name']); $email = trim($_REQUEST['email']); $facebook_handle = trim($_REQUEST['facebook_handle']); $twitter_handle = trim($_REQUEST['twitter_handle']); $bio= trim($_REQUEST['bio']); $insert_sql = "INSERT INTO user (first_name, last_name, " . "email, facebook_handle, twitter_handle, bio) " . "VALUES ('{$first_name}', '{$last_name}', '{$email}', " . "'{$facebook_handle}', '{$twitter_handle}', '{$bio}');"; mysql_query($insert_sql); // $user_id = $_REQUEST['user_id']; header('Location: show_user.php?user_id=' . mysql_insert_id()); // $user_id = $_REQUEST['user_id']; // exit(); // or die(mysql_error()); ?> _______________________________________________ INDEX.HTML _______________________________________________________________________ <!-- To change this template, choose Tools | Templates and open the template in the editor. --> <!DOCTYPE html> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <div id="header"><h1>PHP & MYSQL: uuuuuuuuuuuu</h1> </div> <div id="content"> <form action="create_user.php" method="POST" enctype="multipart/form-data"> <fieldset> <label for="first_name">First Name:</label> <input type="text" name="first_name" size="20" /><br /> <label for="last_name">Last Name:</label> <input type="text" name="last_name" size="20" /><br /> <label for="email">Email Address:</label> <input type="text" name="email" size="20" /><br /> <label for="facebook_handle">Facebook Handle:</label> <input type="text" name="facebook_handle" size="20" /><br /> <label for="twitter_handle">Twitter Handle:</label> <input type="text" name="twitter_handle" size="20" /><br /> <label for="user_pic">Upload a Picture:</label> <input type="file" name="user_pic" /></br> <label for="bio">Bio:</label> <textarea name="bio" cols="40" rows="10"></textarea> </fieldset> <br/> <fieldset class="center"> <input type="submit" value="Join the Club" /> <input type="reset" value="Clear and Restart" /> </fieldset> </form> </div> </body> </html> _____________________________________ SHOW_USER.PHP _________________________________________________________________ //require_once 'create_user.php'; require_once 'connect.php'; $user_id = $_REQUEST['user_id']; $select_query = "SELECT * FROM user WHERE user_id = " . $user_id; $result = mysql_query($select_query); if ($result) { //get the query result rows using $ result $row = mysql_fetch_array($result); $first_name = $row['first_name']; $last_name = $row['last_name']; $bio = $row['bio']; // $email = $row['email']; // $facebook_handle = $row['facebook_handle']; // $twitter_handle = $row['twitter_handle']; } else { die ("Error locating user with ID {$user_id}"); } ?> <html <head> // user end up here by using the create_user.html and create_user.php. //also my loggin in and clicking "my profile". //selecting a particular user from a list. </head> <body> <div id="header"><h1>The first creatative site phil morales</h1></div> <div id="example">User Profile</div> <div id="contect"> <div class="user_profile"> <h1><?php echo "{$first_name} {$last_name}"; ?></h1> <p><img src="<?php echo $user_image; ?>" class="user_pic" /> <?php echo $bio; ?></p> <p class ="contact_info">Get in touch with $first_name:</p> </div> </div> </body> </html>
  23. Developing CART for Online Shopping I am trying to add buttons on html page and the code is working............I have some products in <SELECT> tag i.e. Product 1,Product 2,Product 3,Product 4,Product 5......... I create an array "list_array" and storing all the values in array dynamically... I click on <BUTTON>ADD </BUTTON> and it reads the value from <SELECT> tag and add it into array...........To display all the products, I execute the loop and display all the items in array with a <BUTTON>REMOVE</BUTTON> in-front of every product.......... To delete the particular product, I can select it in <SELECT> tag and then click on delete button..........It removes the element from array .........To display the cart, I am using the loop again, and it shows all the products after clicking the <BUTTON>Display</BUTTON> Now the issue that I am facing here is that I am adding <BUTTON>REMOVE</BUTTON> button when I am displaying the products that have been added in CART, the code of java_script is listed below function display() { string = ""; str=""; for(j=0;j<i;j++) { str = list_array[j]+"_"+j; string = list_array[j]+" <button onclick='remove_me(this)' id="+str+">Remove</button><br>"+string; } document.getElementById('write').innerHTML = "Array:<br> " + string; document.getElementById('i_val').innerHTML = "I: " + i; } Now, I am trying every way to make a code that will help me in removing the product by clicking on <BUTTON>REMOVE</BUTTON>, I hope I have explained everything here, so, help me to fix this issue...............
  24. I have a div I use for dialogs and I want to pass a string to the div and then show the specific twig template as an include. The div dialog is displayed without the template embedded, What am I doing wrong, is there a better way to do it? $('#new').click( function() { var str = " {% include 'catalogue_form.html' %} "; $('#dialog').text(str).html(); showDialog(); }); function showDialog() { $('#dialog_wrapper').fadeIn(); $('#dialog').fadeIn("slow"); } Thanks in advance, James
  25. Hi, I'm turning a 2 level nav into a 3 level and running into a few difficulties. The 3rd level displays where and as predicted but when the 'grandparent' is hovered over, not the parent of the items I want displayed. I've been fooling around with the css for a while and I cannot get it to respond how I'd like. Any help is appreciated. There is a fiddle as my explanation might be somewhat lacking. http://jsfiddle.net/6TGaf/ Code from fiddle: #nav{ background: #bada55; width: 99%; margin-top:-5px; } #nav ul{ list-style: none; margin: 0; padding: 0; height: 40px; } #nav ul li{ /*child elements positioned absolutley will be relative to this*/ position: relative; border-top: 1px solid #e9e9e9; float: left; } #nav a{ color: ghostwhite; padding: 12px 0px; /*fill hori space*/ display: block; text-decoration: none; /*apply transition to background property, taking 1s to change it */ transition:padding 1s, background 1s; -moz-transition:padding 1s, background 1s; -webkit-transition:padding 1s, background 1s; -o-transition:padding 1s, background 1s; font-family:tahoma; font-size:13px; text-transform:uppercase; padding-left:20px; } /*hover pseduo class*/ #nav a:hover{ /* RGBA background for transparancy: last number(0.05) is the transparency */ padding-left:35px; background: RGBA(255,255,255,0.05); color:#fff; } #nav ul li:hover ul{ /*diplay when hovered*/ display: block; } #nav ul ul{ position: absolute; left: 0px; top: 40px; border-top: 1px solid #e9e9e9; display: none; /*width: 304px;*/ z-index: 1; } #nav ul ul li{ width: 150px; background: #f1f1f1; border: 1px solid #e9e9e9; border-top: 0; /*float:left;*/ } #nav ul ul li a{ color:#000000; font-size:12px; text-transform:none; } #nav ul ul li a:hover { color:#929292; } /*3rd level...*/ #nav ul ul ul{ position: absolute; left: 150px; top: 0px; border-top: 1px solid #e9e9e9; display: none; /*width: 304px;*/ z-index: 1; } #nav ul ul ul li{ width: 150px; background: #f1f1f1; border: 1px solid #e9e9e9; border-top: 0; } #nav ul ul ul li a{ color:#000000; font-size:12px; text-transform:none; } #nav ul ul ul li a:hover { color:#929292; } #nav ul ul li:hover ul{ /*diplay when hovered*/ display: block; } <nav id = "nav"> <ul> <li> <a href="#">1.1</a> <ul> <li> <a href="#">1.1.1</a> <ul> <li><a href="#">1.1.1.a</a></li> <li><a href="#">1.1.1.b</a></li> </ul> </li> <li><a href="#">1.1.2</a></li> <li><a href="#">1.1.3</a></li> </ul> </li> </ul> </nav>
×
×
  • 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.