Jump to content

newbreed65

Members
  • Posts

    44
  • Joined

  • Last visited

    Never

About newbreed65

  • Birthday 05/14/1986

Contact Methods

  • MSN
    andrewhughes666@hotmail.com
  • Website URL
    http://www.andyhughes.co.uk/

Profile Information

  • Gender
    Male
  • Location
    Cheshire, England

newbreed65's Achievements

Member

Member (2/5)

0

Reputation

  1. Hiya everyone I'm currently working on a project where I need to be able to log certain information by Ajax running a php page behind the scene that logs the information in a database. I can get this working fine when both verbiage's are located on one domain server but I'm having difficulty getting it to work when there on separate servers... I'm ab it of a noob when it comes to Ajax and got a feeling I'm trying to wrong thing when your need to interact with different servers, just a lil unsure were to go now Below is the code i have currently function getXMLHTTPRequest() { try { req = new XMLHttpRequest(); } catch(err1) { try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch (err2) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch (err3) { req = false; } } } return req; } var http = getXMLHTTPRequest(); function getServerText() { var myurl = 'http://www.ftp5.dns-systems.net/~guardhog/test.php'; myRand = parseInt(Math.random()*999999999999999); var client = "&client=123456" var modurl = myurl+"?rand="+myRand+client; http.open("GET", modurl, true); http.onreadystatechange = useHttpResponse; http.send(null); } function useHttpResponse() { if (http.readyState == 4) { if(http.status == 200) { var mytext = http.responseText; document.getElementById('myPageElement').innerHTML = mytext; } } else { document. getElementById('myPageElement').innerHTML = ""; } }
  2. Hi I am currently trying to transfer a file from my server to another one via SFTP and I’m not having any luck at all. it just keeps failing to connect although I know the ftp detail are correct since I can connect it via core ftp, can anyone help me with SFTP transfers? here is my current code $ftp_id = ftp_ssl_connect($ftp_server) or die ('Cant Connect'); $login_result = ftp_login($ftp_id, $ftp_user_name, $ftp_user_pass)or die ('Cant login'); $upload = ftp_put($ftp_id, $ftp_path . $file_name, $file_path, $mode)or die ('upload dint work'); ftp_close($ftp_id);
  3. Thanx for that just before i looked on your post i tried the same thing and it look like its worked havent double checked thou lol
  4. Hi Everyone In PhpMyAdmin I’m trying to get a list of clients from the clients table that don’t have any claims linked to them in the Claims table, I can get all the ones that have claims but don’t know how to get the ones that don’t have claims Any Help? Here are a few of my failed attempts SELECT`Clients`.*, `Claims`.`ClientID` FROM `Clients` WHERE`Clients`.`ID`!=`Claims`.`ClientID`) SELECT`Clients`.* FROM `Clients` JOIN `Claims` ON (`Clients`.`ID`!=`Claims`.`ClientID`)
  5. Hi everyone I’m currently working on a Image gallery that in the future I can add to sites that need one but I’m currently having problem find a simple way of splitting the images up into group. For example if there were 50 images in my gallery it would be split up into pages of 24 with the remainders on the last page. Can anyone help me? This site is a good example of what I’m trying to do http://www.comicartcommunity.com/gallery/search.php?show_result=1 and here the gallery at the moment and its relevant code http://www.andyhughes.co.uk/development/imagegallery/ <?php $images = "image_gallery/"; // Location of small versions $big = "big/"; # Location of big versions (assumed to be a subdir of above) $cols = 6; # Number of columns to display if ($handle = opendir($images)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && $file != rtrim($big,"/")) { $files[] = $file; } } closedir($handle); } $filecount = count(glob("" . $images . "*.jpg")); echo "<p>Images (" . $filecount . ")</p>"; if ($filecount == 0) { echo "<h1>No Images Currently in the Gallery</h1>"; } else { rsort($files); $colCtr = 0; echo '<table width="100%" cellspacing="3"><tr>'; foreach($files as $file) { if($colCtr %$cols == 0) echo '</tr><tr><td colspan="' . $cols . '"><hr /></td></tr><tr>'; echo '<td align="center"><a href="index.php?image=' . $file . '"><img src="' . $images . $file . '" /></a></td>'; $colCtr++; } echo '</table>' . "\r\n"; } ?>
  6. As you will see from the code below i have a MYSQL Query which adds a person data to my database, but when it come to the next part were i upload the persons image (if they have added one) I want to use the value from the primary key (person_id) ) that is Auto incremented as the images name, is there away to just get the ID instead if running another query like you would if you were displaying the data on a page $sql = "INSERT INTO team (person_firstname, person_surname, person_role, person_info, person_image) VALUES ('" . mysql_real_escape_string($firstname) . "', '" . mysql_real_escape_string($surname) . "', '" . mysql_real_escape_string($role) . "', '" . mysql_real_escape_string($info) . "', '" . mysql_real_escape_string($image) . "')" ; mysql_query($sql, $conn) or die('Could not submit person; ' . mysql_error()); //if image true then upload image if ($image == true) { require_once '../../includes/image_upload.php'; }
  7. Hi Everyone I'm currently trying to figure out how to deal with more than one array since this is the first time Ive tried doing something like this. below is some code that in the end with be changed into a Update MySQL query case "Save": $test = $_POST['character']; $test2 = $_POST['castid']; foreach ($test as $key=> $person){ echo $person . " "; foreach ($test2 as $key=> $id){ echo $id . " "; echo "<br>"; } } break; What i want the code to do is display the data from the arrays like this.. but currently in this version of the code it getting displayed like this .. Any ideas?? i got a feeling like i might be about this completely wrong
  8. Hey Everyone I'm having a problem with the movie part of the page the link will take you too. http://bulletsnoctane.co.uk/people/person.php?id=5 I'm trying to show all the movie that the person has been attached too but for some reason the first record in the query doesn't show it should be terminator salvation dark knight batman begins not just the last 2 movies, I've double checked the query in phpmyadmin and all 3 records show up <h3>Movies</h3> <?php $sql = "SELECT * FROM casts JOIN movie ON (casts.movie=movie.id) JOIN roles ON (casts.role=roles.id) WHERE person_id=" . $id . " ORDER BY released DESC"; $result = mysql_query($sql) or die(mysql_error()); $cast = mysql_fetch_array($result); if (mysql_num_rows($result) == 0) { echo " <em>currently not attached to any movies</em>"; $table = ""; } else { $table = "<table>"; while ($cast = mysql_fetch_array($result)) { $date1 = $cast['released']; $date2 = explode("-",date("Y-m-d",strtotime($date1)));//splits up the date $table .= "<tr><td>" . $date2[0] . "</td>" . '<td><a href="/movies/movie.php?id=' . $cast['movie'] . '">' . $cast['name'] . "</a></td><td>" . $cast['role_name'] . "</td><td>" . $cast['char_name'] . "</td>"; } } $table .= "</table>"; echo $table; ?> </div>
  9. This is the first time i have ever tried to do this and when i have been looking for help and tutorials well i havnt found anything helpful :-/ , havnt used CURDATE()
  10. ive just tried the below query in phpmyadmin and got the same result the data type im using for released is date SELECT movie.id, movie.name, movie.released FROM movie WHERE released >=2009 -01 -10 ORDER BY released DESC LIMIT 0 , 10
  11. Not look sorry the dates are stored as date("Y-m-d") in the database then when you scroll down and explode the and change it into how it is show on the page while ($row = mysql_fetch_array($result)) { $date1 = $row['released']; $date2 = explode("-",date("Y-m-d",strtotime($date1)));//splits up the date echo '<a href="/movies/movie.php?id=' . $row['id'] . '">' . htmlspecialchars($row['name']) . "</a> | "; echo $date2[2] . "/" . $date2[1] . "/" . $date2[0]; echo "<br />"; } }
×
×
  • 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.