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 guys i typed and saved som text from my admin page, i tried displaying it in my home page but it has some html a nd some styles inlcuded, please how do i convert it to plain text, i already used htmlspecialchars and htmlentities , i noticed some.changes but what i want to is a plain text. This is what it gave me when i viewed it with "htmlspecialchars" <font face="Times New Roman"><b><font size="5">You Are welcomevv</font></b></font> and here is the code i used in displaying-: echo htmlspecialchars($object->data['page-body']) ; Please i need your help. Thanks.
  2. DISCLAIMER: this is my first time on this site, and I am a very beginning programmer still in high school, so please bear with any mistakes I might make. (if you have ANY advice or comments, feel free to share them with me, any help is appreciated) I am basically looking to make a series of css checkboxes (I only have one right now for testing purposes), which will submit onclick and store the value in a txt file. Upon loading, it will read that text document and set the checkbox default to what it was before. I could use the PHP session method, but I would like the default to carry on through reboots, etc. Currently, the file current.txt has a 1 in it, but the checkbox is still off. When I click the checkbox, it refreshes, but then goes back to off. any advice? <!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="mystyle.css"> </head> <body> <form action="index3.php" method="post"> <div class="onoffswitch"> <?php //writing to the file with the results of POST $my_filew = 'current.txt'; $handlew = fopen($my_filew, 'w'); if (isset($_POST["onoffswitch1"]) && $_POST["onoffswitch1"] == "on") { fwrite($handlew,'1'); fclose($handlew); } if (isset($_POST["onoffswitch1"]) && $_POST["onoffswitch1"] == "0ff") { echo "hello"; fwrite($handlew,'0'); fclose($handlew); } //reading from the file and setting the default $my_filer = 'current.txt'; $handler = fopen($my_filer, 'r'); $datar = fread($handler,filesize($my_filer)); fclose($handler); if ($data == 1) { $checked="checked"; } else { $checked=""; } //outputting the html $option='onclick="setTimeout(function() {submit();},1250);"'; echo '<input type="checkbox" name="onoffswitch1" class=onoffswitch-checkbox" id="myonoffswitch" '.$checked.' '.$option.'>'; echo "\n"; ?> <label class="onoffswitch-label" for="myonoffswitch"> <div class="onoffswitch-inner"> <div class="onoffswitch-active"><div class="onoffswitch-switch">ON</div></div> <div class="onoffswitch-inactive"><div class="onoffswitch-switch">OFF</div></div> </div> </label> </div> </form> </body> </html>
  3. Hi i'm new in this forum, but it looks like I can get help here I'm trying to figure out what I've do wrong but can't figure out. The error i get is: Fatal error: Call to undefined function validerFornavn() in /jail/www/inghor/tema5/inkluderevalidering.php on line 5 /* my php code is /* <?php include ("validering-navn.php"); $fornavn=$_POST ["fornavn"]; $etternavn=$_POST ["etternavn"]; $lovligFornavn=validerFornavn($fornavn); $lovligEetternavn=validerEtternavn($etternavn); if(!$lovligfornavn) { print("navn er ikke fylt ut riktig<br/>"); } if(!$lovligetternavn) { print("etternavn er ikke fylt ut riktig<br/>"); } if ($lovligfornavn && $lovligetternavn) { $filnavn="navn.txt"; $filopprasjon="a"; $linje=$fornavn." ".$etternavn."\n"; $fil=fopen($filnavn,$filopprasjon); fwrite($fil, $linje); fclose($fil); print("$fornavn $etternavn er nå skrevet til fil<br/>"); } ?> /* This is the function file I includet "validering-navn.php" /* function validerFornavn($fornavn) { $lovligfornavn=1; if (!$fornavn) { $lovligfornavn=0; } if ($lovligfornavn) { return true; } else { return false } } Function validerEtternavn($etternavn) { $lovligetternavn=1; if (!$etternavn) { $lovligetternavn=0; } if ($lovligetternavn) { return true; } else { return false; } } ?> /** and this is my html */ <!DOCTYPE html> <html> <head> <title> navn tekstfil </title> </head> <body> <h3> navn tekstfil </h3> <form method="post" action="inkluderevalidering.php" id="inkludervalidering" name="inkludervalidering"> fornavn <input type="text"id="fornavn" name="fornavn"/><Br/> etternavn <input type="text" id="etternavn" name="etternavn"/><br/> <Input type="submit" value="fortsett"id="fortsett" name="fortsett"> <input type="reset" value="nullstill"id="nullstill"name="nullstill"><br/> </form> </body> </html>
  4. i have want to include external geturls.php located in other domain, on select option of omain in same forum single sub,it button how to switch include include('domain1.com/geturl.php')include('domain2.com/geturl.php').... <body> <? include('geturl.php'); ?> <script type="text/javascript"> function ismaxlength(obj){ var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : "" if (obj.getAttribute && obj.value.length>mlength) obj.value=obj.value.substring(0,mlength) } </script> <?PHP $id = md5(rand(6000,99999999999999991000)); ?> <td style="text-align: right;" colspan="21"> <font size="-1"><span style="font-family: Helvetica,Arial,sans-serif;"> <form method=post action="http://order.<?php echo $yourdomain?>/register2.php"> <table id="regtab"> <tr><th>Username<td><input type=text name=username size=30 value="" maxlength="16" onkeyup="return ismaxlength(this)" ><select size="1" name="website_category"> <option>domain</option> <option>domain1</option> <option>domain2</option> <option>domain3</option> <option>domain4</option> <option>domain5</option> <option>domain6</option> </select> <tr><th>Password<td><input type=password name=password size=30 maxlength="8" onkeyup="return ismaxlength(this)" > <tr><th>Email Address<td><input type=text name=email size=30 value="" > <tr><th> <td> <tr><th>Site Category<td> <select size="1" name="website_category"> <option>Personal</option> <option>Business</option> <option>Hobby</option> <option>Forum</option> <option>Adult</option> <option>Dating</option> <option>Software / Download</option> </select> </td> <tr><th><td> <tr><th>Site Language<td> <select size="1" name="website_language"> <option>English</option> <option>Non-English</option> </select> </td> <input type=hidden name=id value="<?PHP echo $id; ?>"> <tr><th>Security Code<td><img src="http://order.<?php echo $yourdomain?>/image.php?id=<?PHP echo $id; ?>" width="200" height="75"> <tr><th> <td> <tr><th>Enter Security Code<td><input type=text name=number size=30> <tr><th> <td> <tr><th colspan=2><input class="tempbut" type=submit value="Register" name="submit" align="left"> </table> </form> </body> </html> below is get url code <? $yourdomain = $_SERVER['HTTP_HOST']; $yourdomain = preg_replace('/^www\./' , '' , $yourdomain); $yourdomain = ucfirst($yourdomain); ?>
  5. so I have a query that I need to basically split in half to display in two section on the web page. I have a left side and a right side that will be filled with random selected images from the database. <body> <div class="leftbar"> 4 images here </div> <div class="maincontent"> main content of viewed page </div> <div class="rightbar"> next 4 images here </div> </body> is there a way this can be done? the query i would be using would look like this... except I need to spit the results in half to display in the two "leftbar" and "rightbar" sections $images = mysqli_query($con, "SELECT * FROM pictures ORDER BY RAND() LIMIT 8") or die("Image Query Failed: ".mysqli_error($con));
  6. 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.
  7. 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>"; ?
  8. 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>"; } } ?>
  9. 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
  10. 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" ?
  11. 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.
  12. 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']; }
  13. 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
  14. 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 --------------------*/
  15. 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?
  16. 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.
  17. 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"; } ?>
  18. 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.
  19. 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?
  20. 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 ?
  21. 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?
  22. 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
  23. 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
  24. 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>
  25. 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 *********************************************** -->
×
×
  • 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.