Jump to content

eddy556

Members
  • Posts

    85
  • Joined

  • Last visited

Everything posted by eddy556

  1. Hi, I'm having a problem with the ampersand & symbol. What is happening is I have a script searching the contents of a folder and displaying them using PHP with a link so they can be streamed using a media player. Everything works fine except when a filename has the & symbol in it. The link to the file gets generated and stopped where the & would appear. I know the code for & is %26 but I'm not sure how I can code it so that it replaces all & with %26. Here is my section of code which generates the link: "<a href='embed.php?mp3=$filename&name=$file' onClick='return popup(this, \"notes\")'><img src='stream.gif' alt='Stream this song' width='14' height='14' border='0'></a>"; where $filename would return something like "http://192.168.1.73/embed.php?mp3=Media/A/Aerosmith - Walk This Way.mp3&name=Aerosmith - Walk This Way" but a file with a & in it will prevent the script (embedded media player) receiving the mp3 and name variables to stop reading at the & symbol. Thanks for any help
  2. Hi, I've got a webserver running with PHP which serves media files using links. In order to allow the file to be embedded on the page I have used this link echo "<a href='embed.php?mp3=$filename&name=$file' onClick='return popup(this, \"notes\")'><img src='stream.gif' alt='Stream this song' width='14' height='14' border='0'></a>"; I have no idea how to get around this. Is it something to do with HTMLENTITIES()?? Thanks :-)
  3. Nah sorry its running Windows Server 2003 (I tried Ubuntu but there are no drivers for my GFX card). Any windows versions of this? Thanks
  4. Hi, I'm running Apache with basic Auth running on it to authenticate users. My question is how do I block a certain IP address after an x number of failed access attempts? Thanks :-)
  5. Hi, I've had a webserver set up for around a month now but recently the log has started reporting wierd errors. Here is an example: 172.188.188.5 - - [24/Aug/2007:19:00:39 +0100] "SEARCH /\x90\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\ xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\ xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\ 414 250 I mean whats going on here? I also seem to be getting random IP addresses requesting PHP scripts located elsewhere: 58.61.155.13 - - [31/Aug/2007:09:54:46 +0100] "GET http://www.nassc.com/pr.php HTTP/1.1" 401 401 Are these hacking attempts? Is there anything I should do to prevent these? Thanks
  6. This is the code from my stylesheet: a.textsmall {color: white; text-decoration:none; font-size:smaller; font-family:Verdana, Arial, Helvetica, sans-serif} and this is the part of my HTML which uses it <a class="textsmall" href="index.php" onClick="return targetopener(this,true,true)">close<img src="close.gif" border="0"></a> however it doesn't work can you see any problems? Thanks
  7. Just solved it...I'm dumb lol echo "<a href='embed.php?mp3='$filename' onClick='return popup(this, \"notes\")'><img src='stream.gif' alt='Stream this song' width='14' height='14' border='0'></a>"; I had an extra ' just before $filename when I needed to remove this as I had already opened a ' just before embed.php
  8. Thank you that would help if I wanted the link to appear in HTML but I am wanting PHP to reproduce that. Thanks for pointing it out though I never noticed that
  9. OKay wel when I had the code: <a href="embed.php?mp3=<?php echo $filename ?>" onClick="return popup(this, 'notes')"><img src="stream.gif" alt="Stream this song" width="14" height="14" border="0"> $filename works and I also call it from other places and that works fine so I can deduce that $filename works correctly and is populated with the right data. What other code are you wanting? The whole script is 71 lines. Should I post the lot?
  10. Okay that gets rid of the errors however '$filename' is not returning and is being left blank so I end up with an URL like embed.php?mp3= for the link
  11. Hi, I'm writing a PHP application which deals with mp3 files and uses a bit of javascript. However I cannot get PHP to output this following line correctly without errors: <a href="embed.php?mp3=<?php echo $filename ?>" onClick="return popup(this, 'notes')"><img src="stream.gif" alt="Stream this song" width="14" height="14" border="0"></a> At the moment I close PHP ?> put this line in and open PHP again <?PHP Please can you post a PHP line to output the above? Thanks :-)
  12. Okay so here's my understanding of what I'm meant to do... I have just realised there is a file libmySQL.dll in the bin folder of my MySQL installation. Am I meant to copy this file to my PHP root directory? Previously I was using a libmysql.dll which I just downloaded off the net and its around half a MB smaller than the one in the MySQL bin folder. Also do I leave the original file in place? I have tried this and restarted the server but it has still not worked with the same error. Would it help to upload my php config file? Does the MySQL folder need a PATH variable? Thanks :-)
  13. Okay just found this error: PHP Warning: PHP Startup: Unable to load dynamic library 'C:/Program Files/PHP/php_mysql.dll' - The specified module could not be found.\r\n in Unknown on line 0 and this is repeated twice...however I have checked and double checked that the file is in the correct place
  14. Okay this is what I have: Configuration File (php.ini) Path C:\WINDOWS Loaded Configuration File C:\Program Files\PHP\php.ini Should the path be C:\WINDOWS? I am pretty sure php.ini is being read correctly as I can turn of error reporting and the effects take place after restarting the server...but I don't understand why C:\WINDOWS is showing up?
  15. Okay I've had this problem for a while and I have done absolutely everything I can find on the internet about this. I have PHP version 5.2.3 and MySQL Server 5.0 both installed and working fully independently of each other...however I just cannot get them to work together. I have downloaded both libmysql.dll and php_mysql.dll and both are located in the folder C:\Program Files\PHP. I have also updated php.ini correctly (i think anyway) but just to check here are the affected lines: extension_dir = "C:/Program Files/PHP/" extension=php_mysql.dll I have also changed the PATH variable in the windows environment variables so at the end I have: C:\Program Files\PHP\ with a semi-colon before the previous entry...and restarted afterwards. I can't figure out the problem at all...there is no mention on MySQL when I call the function phpinfo() Hopefully one of you know whats going on! I'm sure there's a simple solution :-)
  16. I have a media server which currently serves mp3 files over my network or the internet. However I currently just have a multitude of folders (A-Z) each storing different mp3s which are searched everytime a different letter page is requested. I realise that I should possibly have a database which would be queried instead of the files themselves...however how would this setup work with PHP? Also how would I feed in the information from my current mp3s into the database? Thanks :-)
  17. I am using a server which required Basic HTTP Authentication. I want a way to somehow log the user out? Is this possible? I realise with this kind of authentication the browser just keeps repeating the username and password everytime the user requests a new page, but is there a way to force the browser to forget these? Just a thought. Thanks
  18. Hi, I have a PHP script which displays all the mp3 files within a folder to users on a webpage. I also have another script which reads through each of these files IDE tag in order to display the length of each file next to its name on the webpage. However this can cause a while for the page to load as it must go thru each file separately and read its tag. I know there are other sites on the web that do this without long page loads....how do they do this? I was thinking there must be a way to go through each file say once a day and then when the user views the page they are just viewing the results of the latest 'crawl'. Any ideas much appreciated. Thanks
  19. How can I gain access to the username variable obtained in basic authentication in Apache 2.2 within PHP so I can display it to the user? Thanks
  20. I;ve got a bit of a problem with the way I have created a PHP script in terms of security. I have a server which serves media files from any of the folders A-Z. These are accessed through the index.htm page with has a variable passed to in in the URL. This variable is related to the folder name...so for example if the user wants to access the files in folder F they click a link which sends the variable F to index.htm which then searches for that folder and displays its contents. However I realised that carefully crafting the URL it is possible to access any folder (for example guessing a name or using ..) My question is how can I prevent this? Thanks
  21. Is it possible within php to read the information from mp3s such as track length etc?
  22. Are there any functions available in php that will count the amount of files in a folder + its subfolders and return the answer? I'm sure there must be a simple answer for this Thanks
  23. Hi, I'm using the mod_auth_basic type in order to allow people to log in to view pages php pages on my Apache 2.2 server. Is it possible to somehow access the username variable from mod_auth_basic so that I can have the username displayed on my pages after they have logged in? 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.