- JQuery conflicting with bootstrap
-
JQuery conflicting with bootstrap
Hi all, I'm using an autocomplete script which works really well. Only problem is its stopping modal fades, tooltips etc within the bootstrap framework. Here is the suspect piece of code: <script type="text/javascript"> $(function(){ $(".search").keyup(function() { var searchid = $(this).val(); var dataString = 'search='+ searchid; if(searchid!='') { $.ajax({ type: "POST", url: "search.php", data: dataString, cache: false, success: function(html) { $("#result").html(html).show(); } }); }return false; }); jQuery("#result").live("click",function(e){ var $clicked = $(e.target); var $name = $clicked.find('.name').html(); var decoded = $("<div/>").html($name).text(); $('#searchid').val(decoded); }); jQuery(document).live("click", function(e) { var $clicked = $(e.target); if (! $clicked.hasClass("search")){ jQuery("#result").fadeOut(); } }); $('#searchid').click(function(){ jQuery("#result").fadeIn(); }); }); </script> I've narrowed it down to this bit: jQuery("#result").live("click",function(e){ var $clicked = $(e.target); var $name = $clicked.find('.name').html(); var decoded = $("<div/>").html($name).text(); $('#searchid').val(decoded); }); jQuery(document).live("click", function(e) { var $clicked = $(e.target); if (! $clicked.hasClass("search")){ jQuery("#result").fadeOut(); } }); $('#searchid').click(function(){ jQuery("#result").fadeIn(); }); }); </script> But I can't for the life of me figure out a work around! Does anyone have any experience with this? Many thanks
-
Exporting Wordpress Content into Bespoke Website
Thanks for the reply. I'll see how it goes when the time comes
-
Exporting Wordpress Content into Bespoke Website
I'm shortly going to be recieving an SQL dump of a wordpress website with a few thousand posts, attachments to those posts and so forth. I am building a bespoke user based website with PHP and mySQL backend. Does anyone have any experience on how best, easily and efficiently to migrate posts from a wordpress SQL dump into a custom database? From what I can see, wordpress puts everything in a posts table. This includes seperate entries for attachments and revisions. Ideally on my setup I will be having a different table for posts, different table for attached files and a different table for categories. All inter-relational. Any help or pointers to some information / tools would be great Thanks for listening
-
PHP, LDAP and IIS Authentication
Silly me, I had "); ' at the end, when all I needed was a ' - it seems to have connected now
-
PHP, LDAP and IIS Authentication
Hi all, I'm venturing into LDAP authentication and I want to simply start by connecting to our active directory. Here is the code I have: <?php // LDAP variables $ldap['user'] = 'admin'; $ldap['pass'] = '************'; $ldap['host'] = 'organisation.local'; $ldap['port'] = 389; $ldap['dn'] = 'CN='.$ldap['user'].',OU=ICT Support,OU=Users,OU=Organisation,DC=Organisation,DC=local"); '; $ldap['base'] = ''; // connecting to ldap $ldap['conn'] = ldap_connect( $ldap['host'], $ldap['port'] ) or die( "Could not connect to server {$ldap['host']}" ); // binding to ldap $ldap['bind'] = ldap_bind( $ldap['conn'], $ldap['dn'], $ldap['pass'] ); if( !$ldap['bind'] ) { echo ldap_error( $ldap['conn'] ); exit; } // search for the user on the ldap server and return all // the user information $ldap['result'] = ldap_search( $ldap['conn'], $ldap['base'], 'uid='.$ldap['user'] ); if( $ldap['result'] ) { // retrieve all the entries from the search result $ldap['info'] = ldap_get_entries( $ldap['conn'], $ldap['result'] ); } else { echo ldap_error( $ldap['conn'] ); exit; } if( $ldap['info'] ) { // Add the user's department name and email address // to the session $_SESSION['userdept'] = $ldap['info'][0]['department'][0]; $_SESSION['usermail'] = $ldap['info'][0]['mail'][0]; } else { echo ldap_error( $ldap['conn'] ); exit; } // close connection to ldap server ldap_close( $ldap['conn'] ); ?> I can confirm the code can see the active directory, as if I change the name of it, it throws the error "Can't contact LDAP server", whereas with the correct details it will then say "Invalid credentials". I can vow 100% that the username and password are correct, but still it doesnt like it. I have a peice of software called "Softerra LDAP Administrator 2011", I then browsed the OU that contains the user, and then clicked "Properties" to obtain the location, then copied and pasted it into the code you see above. Am I missing something here? LDAP is completely new to me, and it would be great if I could get it working! Nick
-
APC + uploadprogress - Can not get any scripts to work!
Darn it! I've found a way to do it with PERL. I will stick with this, just need it to work! I've no idea why it doesn't work on my server. Cheers for the help
-
APC + uploadprogress - Can not get any scripts to work!
Hey rallport, many thanks for pointing that out! The "tmp" folder is in the root directory. It was 755, I changed it to 777, tried another upload but still no indication of the progress bar moving along. I kept frefreshing the contents of the "tmp" folder but no files seemed to appear.. Is there something fundamental I'm missing here? Nick
-
APC + uploadprogress - Can not get any scripts to work!
Hi Jock, thanks for the reply I have a folder called "uploads", not one called "tmp". I can't see any reference to a "tmp" folder. Although I do see: move_uploaded_file($_FILES['file']['tmp_name'], $path) Although this doesn't reference a directory... unless I'm THAT naive!! lol But the file is successfully uploaded yes. There's just no indication of progrress, you will see if you visit the link and upload a file. Nick
-
APC + uploadprogress - Can not get any scripts to work!
Hello all, hope all is well. I'm trying to get a simple file upload script to work (with progress indicator) and have been trying for many days to no avail. I have a flash one installed that works perfectly, but because this script will be used mainly behind proxy servers flash seems to be out of the question due to http errors (unless anyhone knows a work around which doesn't involve openening ports etc). I have APC and UPLOADPROGRESS installed, see my phpinfo: http://77.74.193.44/~sss/phpinfo.php - this looks right to me, unless I'm missing something? I'm using this simple code which uses uploadprogress (which is located here: http://77.74.193.44/~sss/uploaders/9/) This is one of 10 different scripts I've tried, all using a mixture APC and UPLOADPROGRESS. Recently I've been reading that APC wont run on a server with fastCGI which is no good to me! - Is this the same with uploadprogress? Here are the three files I have in relation to http://77.74.193.44/~sss/uploaders/9/ upload.php <?php if ($_FILES['file']['error'] === UPLOAD_ERR_OK) { $path = './uploads/' . basename($_FILES['file']['name']); move_uploaded_file($_FILES['file']['tmp_name'], $path); } ?> getprogress.php <?php if (isset($_GET['uid'])) { // Fetch the upload progress data $status = uploadprogress_get_info($_GET['uid']); if ($status) { // Calculate the current percentage echo round($status['bytes_uploaded']/$status['bytes_total']*100); } else { // If there is no data, assume it's done echo 100; } } ?> index.php <?php // Generate random string for our upload identifier $uid = md5(uniqid(mt_rand())); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Upload Something</title> <link href="[url="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/themes/start/jquery-ui.css"]http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/themes/start/jquery-ui.css[/url]" rel="stylesheet" /> <script src="[url="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"]http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script[/url]> <script src="[url="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js"]http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js"></script[/url]> <style> #progress-bar, #upload-frame { display: none; } </style> <script> (function ($) { // We'll use this to cache the progress bar node var pbar; // This flag determines if the upload has started var started = false; $(function () { // Start progress tracking when the form is submitted $('#upload-form').submit(function() { // Hide the form $('#upload-form').hide(); // Cache the progress bar pbar = $('#progress-bar'); // Show the progress bar // Initialize the jQuery UI plugin pbar.show().progressbar(); // We know the upload is complete when the frame loads $('#upload-frame').load(function () { // This is to prevent infinite loop // in case the upload is too fast started = true; // Do whatever you want when upload is complete alert('Upload Complete!'); }); // Start updating progress after a 1 second delay setTimeout(function () { // We pass the upload identifier to our function updateProgress($('#uid').val()); }, 1000); }); }); function updateProgress(id) { var time = new Date().getTime(); // Make a GET request to the server // Pass our upload identifier as a parameter // Also pass current time to prevent caching $.get('getprogress.php', { uid: id, t: time }, function (data) { // Get the output as an integer var progress = parseInt(data, 10); if (progress < 100 || !started) { // Determine if upload has started started = progress < 100; // If we aren't done or started, update again updateProgress(id); } // Update the progress bar percentage // But only if we have started started && pbar.progressbar('value', progress); }); } }(jQuery)); </script> </head> <body> <form method="post" action="upload.php" enctype="multipart/form-data" id="upload-form" target="upload-frame"> <input type="hidden" id="uid" name="UPLOAD_IDENTIFIER" value="<?php echo $uid; ?>"> <input type="file" name="file"> <input type="submit" name="submit" value="Upload!"> </form> <div id="progress-bar"></div> <iframe id="upload-frame" name="upload-frame"></iframe> </body> </html> The file uploads perfectly fine, no problem. But the progress indicator doesn't, it simply just fills in when the whole file is completed. I tried to upload a 100mb file, it uploaded, but no progress indication. The script is at its most basic at the moment, this is why there is no security measures in place on the file handling yet. I just want this to work, then I can start improving the code! Can anyone point me in the right direction as to what I'm missing here? Many thanks, Nick
-
Local Server not showing Error Codes / Line Errors etc
Ah!! I have found it, it is attached error.txt
-
Local Server not showing Error Codes / Line Errors etc
Hi there, Thanks for your reply! I've attached a log that Ive found in the log folder. Cannot see any .htaccess files at all :S access.txt
-
Local Server not showing Error Codes / Line Errors etc
Hi all, I'm working on a server interally at school. There is PHP and mySQL installed on a Windows server. When I get a PHP error all I get is: Server Error 500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed. Is there some code within the PHPINI file I need to change so that It echos a rough idea about the PHP error and what line its on? All webhosting I've used previously (online) has this functionality and its very useful Thanks all Nick
-
PHP Form - File upload. Disappears when user hits back button
Cheers mate thats a great idea, I'll have a look into that
-
PHP Form - File upload. Disappears when user hits back button
Hi all, I'm having a little dilema (again!). I have a form where a user enters details in a number of fields and will upload a file, they enter information into a captcha form and the form gets proccessed. If the details in the captcha form are incorrect the browser send them back. I re-populate all of the form fields with all the data they entered which is great. But the file they selected to upload will not be rememebered - I have tried to echo the data back into the form but nothing appears. <input type="file" name="file1" id="fileField" value="<? echo $_FILES['file1']; ?>"/> Does anyone know if there is a way around this? Nick