Jump to content

ciber

Members
  • Posts

    102
  • Joined

  • Last visited

    Never

Everything posted by ciber

  1. I tried searching google and phpclasses.org for something of this nature, but can't seem to come across anything. (or possibly using the wrong keywords). Basically I am looking for a class that I can instantiate with a URL (or similar), and in turn it will provide me with the appropriate embed code for that video along with a thumbnail. (Thumbnail optional) I currently having something im using, but its restricted purely to YouTube, and wish to expand it to all video providers. Does anyone know of any code available (class) that can provide me with what I mentioned above. Thanks
  2. I dont know what did this, but its irritating the living hell out of me - how can I fix the arrow, and get it centered? (See Attachment) [attachment deleted by admin]
  3. Yea, I think I must generate it, and check rather its better that way!. Thanks for your help.
  4. so if I use PHP's uniqid, will the ID's generated ALWAYS be unique? even if its run on multiple systems? That is why I would prefer using a ticketing system, since regardless it will always be unique.
  5. OK so by using mysql_insert_id(), is there a chance that another request for a key could be executed inbetween the two queries, if your server is very busy and processing thousands of queries? say for example: R1: mysql_query("REPLACE INTO Tickets64 (stub) VALUES ('a')"); R2: mysql_query("REPLACE INTO Tickets64 (stub) VALUES ('a')"); R1: $key = mysql_insert_id(); R2: $key = mysql_insert_id(); where R1 is request 1 by some user, and R2 is another request by another user
  6. basically I got 10 different tables, which I need each to have a unique key throughout the database. see this link: http://code.flickr.com/blog/2010/02/08/ticket-servers-distributed-unique-primary-keys-on-the-cheap/ also I want to transform this into my project next year for university, so im building it large scale, even though it will never run live
  7. Hi, I am currently working on a very detailed personal project during my vacation to keep me busy, but I have a problem, I am trying to create a unique id, without having the chance of a repetition of the id, even if its infinitely small. So I found the flickr ticket id system to be a good choice, since it was sequential and effective. My problem now is, how can I execute 2 queries simultaneously, given the hypothetical change that if I execute them with two separate queries (mysql_query), that there is the chance that another query could be executed in between the break, causing two id's to be the same. Since mysql_query can only execute a single query I am a bit stuck. I thought about possibly using CGI, but then again I have never used it, so I don't know its limitations. Can anyone suggestion anything to me for this problem, as to how I can execute two query strings in the same query.
  8. Hi, Basically I am going to give a short description to my problem with pseduo and comments (-->), there is too much to paste all my code here: basically include(config.php) --> database connection include(global.php) --> class is instantiated here as $p ($p is GLOBAL) --> I print_r the $p value here, and it shows (debugging) switch() case x: include file.php; break; --> but when I try to access it or print_r it here (here being within the file.php), via the file that has been included above "include file.php", it does not see it. I have to re-declare the $p variable with the class, within the included file. any tips as how to solve this please; I dont see why it wouldnt see it, since all the file is that I am including is an HTML file with a few PHP lines, which checks if a user has permission: if(!$p->check()) redirect("index.php");
  9. ciber

    PHP FTP

    nevermind, I can get my new host to wget the file via ssh. thanks
  10. ciber

    PHP FTP

    I still have access via the web interface.
  11. ciber

    PHP FTP

    Hi, I tried searching google with out any luck. I am looking for a script which will allow me to ftp everything from one server to another, I am moving servers and want everything in my one directory to be directly transferred to the new server. The old host is being a bitch now, and wont allow me to use FTP to the server from my pc, or SSH - so I am wanting to FTP my stuff via the server itself using PHP's FTP function. Thanks
  12. Nevermind seems it was something I was doing wrong
  13. I have 2 servers I use for hosting, both Linux and Apache. I am executing the same php script on both, the one server the information is sent to me as it is processed, the other it only sends when it is finished processing the script. How can I change it so that it sends me the stuff as it processes it, and not right at the end? Thanks
  14. I have tried to look google, but was unable to find anything. and the search daemon is giving me errors on this site. So, when I am calling lines from a text file, I am getting a problem. to explain, I will use a # to show were this "white space" is I am getting This is the text file url.com url2.com url3.com when PHP reads the file, and I output it into PHP its reading it like this url1.com# url2.com# url3.com url1.com and url2.com both are getting this "white space" at the end of them, and the last entry does not. I have tried to use str_replace(" ","",$line) and str_replace("\r","",$line) but nothing. can anyone advise me as to what character this is that is being outputed. my code I'm using $f = fopen ("list.txt", "r"); while ($line= fgets ($f)) { if($url == $line){echo $line;} } fclose ($f);
  15. Hi I am wanting to disable a plugin from being used in a specific page template in my wordpress installation, however I need it to work normally on the rest of the site. Is there perhaps a piece of code I could use to prevent a specific plugin from executing on a specific page. for example disable_on_page("plugin_name");
  16. that is accessing an image by means of html ... I am using gd library for image manipulation, and want to know if there is a way to modify the header to include a title.
  17. Nevermind fixed, sorry to post here without thinking correctly!
  18. Found a simple workaround nevermind
  19. Hi, I found this code on the web, and have tried to modify it to include some other features - but it just doesn't want to work. Basically the original code alerts the user that only 5 selections are allows to be made, the part I tried to integrate basically takes the inputs name, and inserts the string below into a div tag: "<img src='traits/"+document.getElementById('trait'+count).value+".png'>"; It then proceeds to making the div visible, but my problem is its not reading the name attribute in the input tag, nor is it showing the image - and when it does show the image link, its showing only 1 or its not hiding it. Basically the script needs to take the selected option, and insert its name field into the img src as mentioned above, but when an option is unselected it must hide that option and shift the images up again, so that the previously selected are shown. Any help will be greatly appreciated!! <script type="text/javascript"> var selectedOptions = []; // Written by: WillyDuitt@hotmail.com \\; var count = 0; function countSelected(select,maxNumber){ for(var k=1; k<6; k++){ document.getElementById('trait'+k).style.visibility = 'hidden'; } for(var i=0; i<select.options.length; i++){ if(select.options[i].selected && !new RegExp(i,'g').test(selectedOptions.toString())){ selectedOptions.push(i); document.getElementById('trait'+count).innerHTML = "<img src='traits/"+document.getElementById('trait'+count).value+".png'>"; // should be the inputs name not value for(var s=1; s<=count; s++){ count++; document.getElementById('trait'+s).style.visibility = 'visible'; } } if(!select.options[i].selected && new RegExp(i,'g').test(selectedOptions.toString())){ selectedOptions = selectedOptions.sort(function(a,b){return a-b}); for(var j=0; j<selectedOptions.length; j++){ if(selectedOptions[j] == i){ selectedOptions.splice(j,1); } } document.getElementById('trait'count).innerHTML = ""; e--; document.getElementById('trait'+e).style.visibility = 'hidden'; } } if(selectedOptions.length > maxNumber){ alert('You may only choose '+maxNumber+' options!!'); select.options[i].selected = false; selectedOptions.pop(); document.body.focus(); } } } </script> <div id="trait1"></div> <div id="trait2"></div> <div id="trait3"></div> <div id="trait4"></div> <div id="trait5"></div>
  20. nevermind I got another idea using this - thanks
  21. will do, just one question what happens when another field, say gender is edited - wont that then remove the setting for name?
  22. Hi, Well I have finally ventured and decided I to use javascript to create a more friendly user interface. basically I need help on how I can do the following: <img src="generate.php?" style="float:right;> <form action="generate.php" method="post"> Name: <input name="name"><br> <select name="attribs"> <option value="atr1">Here 1</option> <option value="atr2">Here 2</option> <option value="atr3">Here 3</option></select><br> Gender: <input type="radio" name="gender" value="male">Male OR <input type="radio" name="gender" value="female">Female </form> So basically the code is an example of what im trying to achieve, but the part of the javascript im struggling with to find is how can I get the images source to update, so as the option are selected the variables are added to the arguments, ie I type my name in, when the form defocuses, the images src updates from generate.php? to generate.php?name=JohnDoe and so forth for the other fields.
  23. Hi, I have created a script that downloads a page, retrieves the image and shows it. It does this by using regex to identify the image within a <div><img></div> tags, but the thing is it keeps giving me an error, could anyone see what my mistake is: /<div id=\"avatar\" class=\"show\">(\\s+)<img src='(.*)' style='border:1px solid #ccc'/>(\\s+)</div>/ src='(.*)' where (.*) is the link im trying to retrieve. Additionally the div id "avatar" is unique to the page.
  24. I am currently using php to call images - but I was wondering, is there a way to 'embed' the images title into the header fields? so that instead of saying "xyz.jpg (JPG Image, 100x100 Pixels)" it says "This is an Image Heading"
  25. Firstly let me explain my directories: /home/user/public_html/ which makes use of mysite.com /home/user/images/ which makes use of img.mysite.com basically I am splitting my images up, to monitor traffic on them - however, I need them to remain in the directory they are in. Therefore, if a file is accessed img.mysite.com, how can I get the server to rewrite to /home/user/public_html/images/ ? thanks
×
×
  • 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.