Jump to content

jaymc

Members
  • Posts

    1,521
  • Joined

  • Last visited

    Never

Everything posted by jaymc

  1. I have a username field in my database that is set to binary, so basically, Jamie is not the same as jamie So in their their may be the following usernames Jamie jamie JaMiE What I want to do is query the database and have it return all the duplicate entries ignoring the rule of character binary Any ideas
  2. IS their anyway I can use it with an array If not, how do I set it out to check for each of those chars listed in the array
  3. [quote]Here is my code <?php $string = "hi &?/\='\",%+ hi"; $patterns[0] = "/&/"; $patterns[1] = "/\?/"; $patterns[3] = "/\//"; $patterns[4] = "/\\\/"; $patterns[5] = "/=/"; $patterns[6] = "/'/"; $patterns[7] = "/\"/"; $patterns[8] = "/,/"; $patterns[9] = "/%/"; $patterns[10] = "/\+/"; if (preg_match($patterns, $string)) {echo "YES";} else {echo "NO";} ?>[/quote] Just wondering why I get an error when running that [i]Warning: preg_match() expects parameter 1 to be string, array given in /home/cff/public_html/testy.php on line 28 NO [/i]
  4. I want to check a variable to see if it contains any of the following chars [code]& ? / \ = ' " , % + ` [/code] I think its best to use preg_match but I'm just a little unsure how to set it all out I know the syntax ... preg_match("banned chars", $var); I just dont know how to format the banned chars in the function Any help?
  5. Edit : Ive sorted it, thanks
  6. Hi, pretty simple question I think Basically, I want to query the database and have it pull out a completely random row, which must have the `group` field equal to 10 Any ideas?
  7. jaymc

    Menu Box

    I'm look for a script that will, well basically its easier to just show you http://forums.cpanel.net Click on SEARCH I want the exact same effect, with the OnClick event
  8. Still doesnt work cheese='The Name's Here' That wont work right? Thats the issue, not the space, the '
  9. Ok, to simplify my problem, I have the following link [code]<div OnClick="window.top.frames['audio'].location.href='../site/music.php?albumid=159&albumname=The Singles&artistname=Basement' Jaxx'">[/code] The problem is concerning this string of text[b] Basement' [/b] now obviously its conflicting with the =' opener and confusing the browser thinking its trying to closer the =  when it hits Basement' But of course its not Anyway around this, any special character so it ignores certain input?
  10. Thanks for both your comments! Ive got it sorted now
  11. Basically, to jump straight into my question I want to have a loop that will echo out a set of <TR><TD>TEXT</TD></TR> for each element in the loop That is fine, however, I want to have every 1,3,5,7,9,11,13 etc etc .. 21,23,25 background colour of the TD to be different than every 2,4,6,8,10,12 etc What is the best way to achieve this I thought maybe if inside the loop I have basically if ($i is odd) {then do this colour} else if ($i is even) {then do this colour} Obviously not syntaxically correct but you get my point Is that the best way? If so, how do I disdinguish an odd number from an even number?
  12. Ah ha, now its working with the SESSION stuff takin out Is their anyway to sort it out so I can have the SESSION test working aswell
  13. Right, I am trying to make a system on my website that can play .wma files via the <embed> tag but stop people downloading them. Here is my embed code... [code]<embed src=http://192.168.1.10/site/streaming.jaydiocity.co.uk.php?streaming-audio-mp3-mega-route10mx-jaydiocity-co-uk=193/3207.wma></embed>[/code] And here is the php code... [code]<? $User_Session = $_SESSION['username']; if ($User_Session == "") {die("HAHA");} else { $file = $_GET['streaming-audio-mp3-mega-route10mx-jaydiocity-co-uk']; if (strstr($file, "../")) {die("Nice try wise guy!");} header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: audio/x-mpeg"); readfile("../AuDiO/$file"); } ?>[/code] Now, I hope you can see exactly how Im going about this by reading my code above... anyway... that is working great ! If I use .htaccess to disable .wma access the system still works and users cant directly download... GREAT! However, I am also using .wax to play a list of songs consecutively (wax is a playlist file, similar to m3u) The wax file looks something like this [code]<ASX version = 3.0> <Title>Blink 182 - Enema Of The State Complete Album</Title> <Entry> <Ref href="708.wma" /> </Entry><Entry> <Ref href="709.wma" /> </Entry><Entry> <Ref href="710.wma" /> </Entry><Entry> <Ref href="711.wma" /> </Entry><Entry> <Ref href="712.wma" /> </Entry> </Entry></asx>[/code] Now hopefully you are straight onto the fact that the wax file will essentially be directly downloading the wma, and as .htaccess is disabling wma files, it wont work! Fair enough, so I amended the wax file to the below [code]<ASX version = 3.0> <Title>Ashlee Simpson - Autobiogpophy Complete Album</Title> <Entry> <Ref href="../../site/streaming.jaydiocity.co.uk.php?streaming-audio-mp3-mega-route10mx-jaydiocity-co-uk=26/400.wma" /> </Entry><Entry> <Ref href="../../site/streaming.jaydiocity.co.uk.php?streaming-audio-mp3-mega-route10mx-jaydiocity-co-uk=26/401.wma" /> </Entry><Entry> <Ref href="../../site/streaming.jaydiocity.co.uk.php?streaming-audio-mp3-mega-route10mx-jaydiocity-co-uk=26/402.wma" /> </Entry><Entry> <Ref href="../../site/streaming.jaydiocity.co.uk.php?streaming-audio-mp3-mega-route10mx-jaydiocity-co-uk=26/403.wma" /> </Entry><Entry> <Ref href="../../site/streaming.jaydiocity.co.uk.php?streaming-audio-mp3-mega-route10mx-jaydiocity-co-uk=26/404.wma" /> </Entry><Entry> <Ref href="../../site/streaming.jaydiocity.co.uk.php?streaming-audio-mp3-mega-route10mx-jaydiocity-co-uk=26/405.wma" /> </Entry><Entry> <Ref href="../../site/streaming.jaydiocity.co.uk.php?streaming-audio-mp3-mega-route10mx-jaydiocity-co-uk=26/406.wma" /> </Entry><Entry> <Ref href="../../site/streaming.jaydiocity.co.uk.php?streaming-audio-mp3-mega-route10mx-jaydiocity-co-uk=26/407.wma" /> </Entry><Entry> <Ref href="../../site/streaming.jaydiocity.co.uk.php?streaming-audio-mp3-mega-route10mx-jaydiocity-co-uk=26/408.wma" /> </Entry><Entry> <Ref href="../../site/streaming.jaydiocity.co.uk.php?streaming-audio-mp3-mega-route10mx-jaydiocity-co-uk=26/409.wma" /> </Entry></asx> [/code] However, that doesnt work. In theory it should... I think, but it doesnt Im just wondering if anyone has any ideas or info about this. Im completely lost, I thought I had it sussed but this .wax accessing the wma's is causing a real headache Hope someone has takin the time to read all that, I know it my be confusing but its not if you can get your head around it Cheers!
  14. Worked great Thanks !
  15. I have the following code... [code]OnClick="return confirmblock(); window.location='http://google.co.uk';"[/code] The problem is, regardless of the [b]confirmblock();[/b] outcome which is [b]ok/cancel[/b] window.location still goes ahead and executes Now I have a fealing the space between [b]return confirmblock[/b] is confusing the javascript and for some reason then ignoring the window.location request in the 2nd part of the OnClick event Any ideas... Thanks
  16. Edit : its ok ive sorted it now thanks for help :)
  17. No... basically when you click browse on any input file box, you select a file from your local HD and the DIR path will be loaded in the text area box.. Well, its not loading in their, obviously because of some kind of issue of how the input box is being loaded
  18. Ahh, Ive ran into a problem     field.innerHTML = "<input type='file' name='send'>"; When the click [b]<span onClick="toBox(this)" id="field">Click here to view the file upload box</span>[/b] The input file box loads fine... great !! But, when clicking browse and selecting a file, the file location does not load into the box I'm guessing because its not fully part of the page code, as it was called upon after the page/form load Any ways around that? Hope Ive explained well enough
  19. Cheers thats exactly what I needed !!
  20. Is their anyway to set the scrollbar style and colour in firefox? Ive never ever had it working in firefox. Im just wondering if its possible Thanks
  21. Ok Im trying to use javascript to set a window.locatiom / href Basically, I have a webpage On that webpage is 2 IFRAMES Iframe 1 is called [b]frame1[/b] and Iframe 2 is called [b]frame2[/b] Now, inside frame1 is a webpage which contains the following code [code]<a href=# OnClick="opener.frames['frame2'].location.href='http://google.co.uk'"[/code] So in otherwords, its trying to load the google site into iframe2 from iframe 1 It doesnt work. Do i need to do something like [b]parent.parentname.opener.frames['songs'][/b] Really stuck...
  22. I want to have a link on a webpage that when clicked the link text is replaced by a form field So, on the webpage would be [b]Click here to view the file upload box[/b] Then when they click that, the 'Click here to view the file upload box' text is replaced with this code [b]<input type='file' name='send'>[/b] Which will obviously display an input box What code would do this effectively. Note, using document.write wont work alone as it will delete the rest of the page contents and jsut write out the form code 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.