Jump to content

ashishrevar

Members
  • Posts

    2
  • Joined

  • Last visited

ashishrevar's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I want to code one PHP script which allows me to generate thumbs of given images with specified dimensions and names as per Next-Gen Gallery Plugin of Wordpress. I have website for cover pages: http://facebook4free.com/ Thumb Gallery Page: http://facebook4free.com/category/facebook-cover-pages/abstract-facebook-cover-pages-facebook-cover-pages/ Main Image Page: http://facebook4free.com/abstract-cover-pages-for-facebook-profile-2/facebook-images/image/1-cover-photo-82140/ Issue is timeout when I upload images in wordpress plugin. It uploads images in create their thumbs but when I upload more than 10 images it fails. So I want to separately create PHP script which create thumbnails of my FB cover pages with given dimensions and specified name (a pattern). Many of the images are in .jpg, .png formats but all are having dimensions of 851x315. Any help would be appreciated.
  2. Dynamic Dependent Select Boxes How to create dependent drop down list in php? I knew it was possible to create a dynamic dependent drop down form using PHP, MySQL, and Javascript, but I had never had an excuse to use one before I need to teach to my students. <?php $region = $country = $state = $city = null; //declare vars $conn = mysql_connect('localhost', 'username', 'password'); $db = mysql_select_db('selects',$conn); if(isset($_GET["region"]) && is_numeric($_GET["region"])) { $region = $_GET["region"]; } if(isset($_GET["country"]) && is_numeric($_GET["country"])) { $country = $_GET["country"]; } if(isset($_GET["state"]) && is_numeric($_GET["state"])) { $state = $_GET["state"]; } if(isset($_GET["city"]) && is_numeric($_GET["city"])) { $city = $_GET["city"]; } ?> <script language="Javascript"> function autoSubmit() { var formObject = document.forms['theForm']; formObject.submit(); } </script> <form name="theForm" method="get"> <!-- REGION SELECTION --> <select name="region" onchange="autoSubmit();"> <option [url=""]value[/url]="null"></option> <option VALUE="1" <?php if($region == 1) echo " selected"; ?>>East</option> <option VALUE="2" <?php if($region == 2) echo " selected"; ?>>West</option> </select> <br><br> <!-- COUNTRY SELECTION BASED ON REGION VALUE --> <?php if($region != null && is_numeric($region)) { ?> <select name="country" onchange="autoSubmit();"> <option VALUE="null"></option> <?php //POPULATE DROP DOWN MENU WITH COUNTRIES FROM A GIVEN REGION $sql = "SELECT COUN_ID, COUN_NAME FROM COUNTRY WHERE RE_ID = $region"; $countries = mysql_query($sql,$conn); while($row = mysql_fetch_array($countries)) { echo ("<option VALUE=\"$row[COUN_ID]\" " . ($country == $row["COUN_ID"] ? " selected" : "") . ">$row[COUN_NAME]</option>"); } ?> </select> <?php } ?> <br><br> <?php if($country != null && is_numeric($country) && $region != null) { ?> <select name="state" onchange="autoSubmit();"> <option VALUE="null"></option> <?php //POPULATE DROP DOWN MENU WITH STATES FROM A GIVEN REGION, COUNTRY $sql = "SELECT STAT_ID, STAT_NAME FROM states WHERE COUN_ID = $country "; $states = mysql_query($sql,$conn); while($row = mysql_fetch_array($states)) { echo ("<option VALUE=\"$row[sTAT_ID]\" " . ($state == $row["STAT_ID"] ? " selected" : "") . ">$row[sTAT_NAME]</option>"); } ?> </select> <?php } ?> <br><br> <?php if($state != null && is_numeric($state) && $region != null && $country != null) { ?> <select name="city" onchange="autoSubmit();"> <option VALUE="null"></option> <?php //POPULATE DROP DOWN MENU WITH CITIES FROM A GIVEN REGION, COUNTRY, STATE $sql = "SELECT CIT_ID, CITY_NAME FROM CITY WHERE STAT_ID = $state "; $cities = mysql_query($sql,$conn); while($row = mysql_fetch_array($cities)) { echo ("<option VALUE=\"$row[CIT_ID]\" " . ($city == $row["CIT_ID"] ? " selected" : "") . ">$row[CITY_NAME]</option>"); } ?> </select> <?php } ?> </form> For complete code visit: http://ashishrevar.com/2012/01/dynamic-dependent-select-boxes/
×
×
  • 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.