Jump to content

zq29

Staff Alumni
  • Posts

    2,752
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by zq29

  1. You won't be doing that with just PHP, I can tell you that much. You'll need to use a client side language to do the closing of the window - JavaScript?
  2. Could you post up your search_for_providers() function too, it looks like the error might actually be in there...
  3. This should work [code]if(!eregi("[a-z0-1_]",$username)) echo "Invalid";[/code] [a href=\"http://www.regularexpressions.info/\" target=\"_blank\"]Click here for a good regular expressions information source.[/a]
  4. Sounds like a server config issue.
  5. Try the file_exists() function - Check the manual for more information.
  6. zq29

    Need help

    I don't think your syntax is correct here, well, I have never seen ternary expressions written like that before... [code]$mpurpose = (!empty($purpose)) ? " AND purposes = '".$purpose."'" : "";[/code]
  7. Heres a list of functions that you could use to write your script... file() - To dump the contents of your text file into an array, loop through it with a foreach loop. strpos() - To see if your search term is found in the current line in the loop. array_push() - To put any matching lines into an array. Or, you could just use the $var[] = "string" method. explode() - To split up your matched lines into an array of words and define an index to return the correct word. Hope that helped some, I would write a demo script but I can't imagine it being quick to write, plus its nearly midnight here... Give it a go, any problems, post up your script and I'm sure you will be helped.
  8. I don't think you can do this with the php.ini nor the httpd.conf file. You [i]may[/i] be able to do it with a .htaccess but I don't know. One solution may be to change the permissions on the files straight after the upload with the chmod() function.
  9. Like this? [code]<script type="text/javascript"> function ShowPrices(node) {     var prices=node.value;     document.getElementById('price').value=prices;     document.getElementById('price').style.visibility="visible"; } function Hideprice() {     document.getElementById('price').style.visibility="hidden"; } </script> <form name="test">     Please, select an option:     <input type="radio" name="pricing" value="£5.00" onclick="ShowPrices(this);">price A     <input type="radio" name="pricing" value="£10.00" onclick="ShowPrices(this);">price B     <br/><input type="text" id="price" value="£0.00"/>     <br>     <input type="submit" name="Request" value="Submit">     <br><br>     <input type="reset" name="Clear" value="Clear form" onclick="Hideprice()"> </form>[/code]
  10. If you're not using any advanced rules for your replacements it would be better to use str_replace() instead of preg_replace(). In which case, you can use it like this: [code]<?php $search = array("old1","old2","old3"); $replace = array("new1","new2","new3"); $str = "old1 old2 old3"; echo str_replace($search,$replace,$str); //The above will echo "new1 new2 new3" ?>[/code]
  11. Could you post up your code so far, or even an explination of what you are trying to acheive with your matryoshka-like arrays - Maybe it could be done without all of the nested arrays.
  12. No PHP is required at this stage...[code]<input type="file" name="photo_filename[]" size="30"> [/code]
  13. Have you read the [i]two[/i] pinned topics in this forum regarding header problems?
  14. Here, [strike]have a screenshot[/strike]. Does it on my computers at home too...
  15. As far as I can work out, the 11 character ASCII string [b]'m741007ë,W[/b] would only convert to a 33 character hexadecimal string. Printable ASCII characters are 3 hex characters long I think. Can you post up any code that you are using to receive the user data?
  16. Please be aware that this forum is not for requesting people to write you scripts - It is for requesting help with scripts that you are writing. But as this is a pretty easy task, here's something that will get you started: [code]<?php $data = ""; $result = mysql_query("SHOW COLUMNS FROM `table`") or die(mysql_error()); while($row = mysql_fetch_array($result)) {     $data .= $row[0].","; } $data = substr($data,0,-1)."\r\n"; $result = mysql_query("SELECT * FROM `table`") or die(mysql_error()); while($row = mysql_fetch_assoc($result)) {     foreach($row as $r) {         $data .= "$r,";     }     $data = substr($data,0,-1)."\r\n"; } $handle = fopen("data.csv","wb") fwrite($handle,$data) fclose($handle) echo "DONE."; ?>[/code] Please note, I have had to leave off the semi-colons after the file functions as there is a bug in the forum that refuses to post a reply with them on.
  17. I'm seeing the whole forum sitting inside one big frame, I have a pair of scroll bars to the right of the window. Is there a second "hidden" frame here somewhere doing something which hasn't been set to hide the scrollbars or something?
  18. psworkshop.net links to lots of good Photoshop tutorials.
  19. [!--quoteo(post=370432:date=May 2 2006, 01:24 AM:name=askjames01)--][div class=\'quotetop\']QUOTE(askjames01 @ May 2 2006, 01:24 AM) [snapback]370432[/snapback][/div][div class=\'quotemain\'][!--quotec--]is that TechTV avatar because it look like the same.[/quote]Thats the logo for the Hip-Hop group Hieroglyphics.
  20. As long as people make a fair effort, I don't mind - Providing they get the point across clearly.
  21. And this must be done by creating a new image? If not, you could just use a HTML table with repeating backgound images to get the same effect...
  22. Topic moved to Misc forum. Core hacking is hacking PHP itself, not PHP scripts. Core hackers create PHP modules et cetera, its done at a low(er) level in C++ I think (I know its one of the C varients).
  23. You could try something like this... [code]<?php //Loop through all text files in a directory foreach(glob("path/to/files/*.txt") as $file) {     $content = file($file);     //Loop through each line in the file     foreach($content as $line) {         //Seperate the line by the pipe symbol into an array and display         $temp = explode("|",$line);         echo "<p>Image: $temp[0]<br/>Title: $temp[1]<br/>Flash: $temp[2]</p>";     } } ?>[/code]
  24. I'll move this to our JavaScript forum. Please be aware, Java and JavaScript are two very different languages!
  25. First of all, the PHP Help forum is for specific PHP scripting problems, so I'll be moving this to a more relevent forum. Yes, I have done it - I have FreeBSD installed on an old machine: 800MHz CPU; 128Mb RAM; 10Gb HDD. But I mainly use this for learning the command line for FreeBSD as I have a couple of dedicated servers with the same OS on, if I want to do something on my live servers I test it out on my test one first so that I know what I am doing! For testing my PHP projects on, I just use my development machine which is running a WAMP set-up.
×
×
  • 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.