Jump to content

Search the Community

Showing results for tags 'txthint'.

  • 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

Found 1 result

  1. I am a Noob at javascript so here goes. I have a slider carousel that is displayed when the webpage loads. It displays a line of images that when clicked on are displayed in larger form below it. I just want know how to automatically load (when the page firsts loads) the last uploaded on the page and then when another image is clicked from the slider carousel its loaded in its place? 2 files index and getuser.php index.php < script type="text/javascript"> jQuery(document).ready(function() { jQuery('.first-and-second-carousel').jcarousel() jQuery('#mycarousel').jcarousel({ start: 5 }); }); function showUser(str) { if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft\l ".XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","getuser.php?q="+str,true); xmlhttp.send(); } </script> <ul id="first-carousel" class\l "="first-and-second-carousel jcarousel-skin-tango"> <li><?php $con = mysql_connect("localhost","base","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("users", $con); $sql = "SELECT * FROM contest ORDER BY member_id DESC"; $result = mysql_query($sql); while($file = mysql_fetch_array($result)){ echo '<li>'; echo '<a href="#" id="'.$file['member_id'].'" onclick="showUser(this.id)"><img src="'.$file['filelocation'].'" width="80" height="95" border="1"></a>'; echo '</li>'; } mysql_close($con); ?></li></ul> <div id="txtHint" style="text-align: center;"> </div> -------------------------------------------------------------------- getuser.php < ?php $q=$_GET["q"]; $con = mysql_connect("localhost","base","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("users", $con); $sql="SELECT * FROM contest WHERE member_id = '".$q."'"; $result = mysql_query($sql); while($file = mysql_fetch_array($result)){ echo '<div align="center" ><img src="'.$file['filelocation'].'" width="650" height="500" border="0"><br> < td>'.$file['title'].'</td><td><br> < td>'.$file['description']. '</td> < /div>'; } mysql_close(); ?>
×
×
  • 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.