Jump to content

genu

Members
  • Posts

    32
  • Joined

  • Last visited

Everything posted by genu

  1. if the content is to be downloaded, however, do I need to convert the entities?
  2. Hey, I'm working on an application that allows users to submit content, but i'm having a hard time understanding how exactly the submitted information is encoded. The content is in another language I know that I have to utilize utf-8 in order to render the special characters correctly. How do I make sure that the characters inputed by the users are utf-8 compliant though? I've noticed that in windows vista, I have two options for the language which I've selected: "legacy" and "standard", and they (although output the same character), the Hex values for them are not ideantical. How is this typically done, so that all user submitted content are subject to the same encoding. Do I need to, perhaps, have buttons to insert special character's html entities via javascript? When storing the submitted data (assuming it was typed with utf-8 characters), do store them in the mysql db as is? or do store their html entity equivalent?
  3. ok... I will try that, although is that the fastest way? would it cause a significant slowdown if, for example, I would have to do that loop for every item in a list -- when rendering a page?
  4. Lets say I have this array and string: $keywords = array('[keyword1]', '[keyword2]', '[keyword3]'); $string = '<h1><strong>[keyword1]</strong></h1><br /> not keyword [keyword2], or keyword <strong>[keyword3]</strong>'; What is the best method that I could strip everything from the $string but the $keywords. so that the end result would just a list of the keywords in $string: keyword1 keyword2 keyword3
  5. Hey, now that I got this function to work. Is it possible to get the same effect from another function that has allow_url_fopen dissabled on the server?
  6. After I posted this, I continue to serach google and PHP.net, and After I added readfile($filename); it seems to have worked. I appreciate the replies...thank you
  7. Hi, i've been working on a function to fetch and "mp3" from a server, and display the "Download" dialog in order to download it. it looks like this: header("HTTP/1.1 200 OK"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Expires: 0"); header("Content-Length: ".$filesize); header("Content-Type: application/force-download"); header("Content-Disposition: attachment; filename=".$filename); header("Content-Transfer-Encoding: binary"); Basically, I'm trying to avoid the mp3 to open with the default player. That function works that it opens the download dialog. The problem is that the file is 0bytes after download. Am I missing something?
  8. Is there a compatible solution (php4 & 5) that would enable me to generate download links to mp3, avi, wmv, etc. That would display a download dialog on click rather than open with the associated program?
  9. Thanks lemmin, that worked...
  10. I tried this: <?php $array = 'test'; $test = array('test1','test2','test3'); echo $$array[0]; ?> but it doesn't return anything
  11. but I don't really know what month that $task is going to be. It could be February, March, April, etc... I have predefined arrays for each one...not just January.
  12. How can I access an array through a variable? for example: I have: $_GET['task'] = "january" and I have a predefined array like so: how can I access the $janurary array based on the the value of $task? I tried: echo $task[0]; but returned just "j" instead of 'test1' is there another way to reference that $january array?
  13. genu

    MP3 link

    is there a way to make an <a href="mp3 url">Download</a> that opens up the download dialog rather than the default player which plays it automatically?
  14. Here is the structure: Table 1 id | BookId | Book_Name | Table 2 id | book_id | Chapter | verse_number | verse_text | in the second table is where all the verses are stored.
  15. well what I'm making is for developers. I'm basically making an api, that allows developers that to retrieve scripture text into their application. So my application doesn't have a user interface. The reason I have spaces in the url, is because I copied the same format from biblegateway. When you type in a search query the url turns to this: http://www.biblegateway.com/passage/?search=matthew%201:1-4,%20luke%207:1-10, but I can just eliminate the space (i guess, to make things easier), but whats the best way to split the search string into the arrays that I need. Its a little tricky, because there can be many search queries not just 3. After every comma, they can type more text references to query. In my code, I explode the query based on the "," but i'm not sure how to split it further to get the book name, chapter and verses for each of the queries...
  16. Ok I was able to import the whole bible into a database with each verse being in a separate field. Now, I want to have it so that when a users passes a chapter/verse through the url, it will fetch that from the database. For example: if they type this: index.php?search=Matthew 1:1-10, Mark 1:1, Luke 1:1, John 1:1 Let me know if this is a good approach. First I use explode(',' $_GET['search) and then use foreach at least two more times to loop through the array and split it even further and then in the end query the database. Is there a simpler method to to separate that string? Because I want it to parse it correctly even when its not in that form. For example, it should work if the user types just index.php?search=Matthew 1:1-10 or Matthew1:1-10,Mark1:1 or even Matthew 1:1-10, 1 John 1:1, basically from all those examples, I need to split into arrays based on the book its in (EX: "John" or "1 John") the chapter, and then the verse sequence (EX "1-10"), which in turn I will use explode('-',$verses) again to get the start verse, and the end verse. Regular expresssions aren't my strong point, but would it be easier to accomplish this task with regular expresssions?
  17. If a file solution would be better, u think we would be using databases? Its way more efficient, as u return one value vs all the values at a time and u can insert/update/delete them by a simple query. thats good point... I'll go ahead and try to migrate it to the database, and I'll see how I can go from there...
  18. well I could easily just query each line, to insert it in a database, but I assument working with files would be a better solution... Would the database be faster? or just more convenient and secure?
  19. Hello, I'm working on a application that returns bible text from a text file. Basically, the user will enter in the url something like: www.mydomain.com/index.php?ver=eng&book=genesis&chapter=1&verse=5 then my script will parse the file eng.txt, which has the whole bible in english for that criteria. Here is how the text file looks like: 01O 1 1 10 In the beginning God created the heaven and the earth. 01O 1 2 20 And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters. 01O 1 3 30 And God said, Let there be light: and there was light. 01O 1 4 40 And God saw the light, that it was good: and God divided the light from the darkness. 01O 1 5 50 And God called the light Day, and the darkness he called Night. And the evening and the morning were the first day. 01O 1 6 60 And God said, Let there be a firmament in the midst of the waters, and let it divide the waters from the waters. 01O 1 7 70 And God made the firmament, and divided the waters which were under the firmament from the waters which were above the firmament: and it was so. 01O 1 8 80 And God called the firmament Heaven. And the evening and the morning were the second day. 01O 1 9 90 And God said, Let the waters under the heaven be gathered together unto one place, and let the dry land appear: and it was so. 01O 1 10 100 And God called the dry land Earth; and the gathering together of the waters called he Seas: and God saw that it was good. 01O 1 11 110 And God said, Let the earth bring forth grass, the herb yielding seed, and the fruit tree yielding fruit after his kind, whose seed is in itself, upon the earth: and it was so. 01O 1 12 120 And the earth brought forth grass, and herb yielding seed after his kind, and the tree yielding fruit, whose seed was in itself, after his kind: and God saw that it was good. 01O 1 13 130 And the evening and the morning were the third day. 01O 1 14 140 And God said, Let there be lights in the firmament of the heaven to divide the day from the night; and let them be for signs, and for seasons, and for days, and years: 01O 1 15 150 And let them be for lights in the firmament of the heaven to give light upon the earth: and it was so. 01O 1 16 160 And God made two great lights; the greater light to rule the day, and the lesser light to rule the night: he made the stars also. 01O 1 17 170 And God set them i... the first number "010" is the book name. In this case "genesis", the second number "1" is the book number (as in the first book of the bible). The next number "1" is the verse number, and the last number i'm not sure what the significance is. Can somebody point me in some sort of direction to create a script to parse this file, and filter out only certain parts of it? I've played around with fopen and fgets, what are other function that I can try? thanks every single verse is on a separate line in the file,
  20. How to I have it so when I fetch the database, it displays only results starting with a certain letter, and also show the "next" button if th results starting with that letter exceed 30 items?
  21. The prototype function works correctly, but when if I for example have a funciton to alert(check_access_name()); it would alert with "undefined", because for some reson it desont return either true or false
  22. [code]function check_access_name(){ var check_access_name = { method: 'post', postBody: 'action=check_access_name&entered_name='+$('board_access_name').value, onSuccess: function(t) { switch(t.responseText){ case '0': $('an').innerHTML = "Access Name is already Taken"; return false; case '1': $('an').innerHTML = "Good"; return true; case '3': $('an').innerHTML = "You cannot leave this blank"; return false; } } } new Ajax.Request('includes/processors/phpbb/build.php', check_access_name); }[/code] For some reason, it doesnt return either "True" or "False" when I use "alert('check_access_name');" it says "undefinded". Why doesnt the function return either true or False?
  23. Hi, here is the problem. Go here: nominations.rbya.org the click "Second/Object" for that first test person. You will see a new popup with a form on it. For some reson ONLY in IE, the "Go" button doesnt work. WHY. I tried erasing all the codei in that popup window, and just put a very simple form with a submit button, but that doesnt submit either. Why doesnt it work? thx
×
×
  • 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.