Jump to content

Strahan

Members
  • Posts

    80
  • Joined

  • Last visited

Everything posted by Strahan

  1. I have a script that creates an .m3u on the web server then pushes it to the client, causing a song to play in Winamp (or whatever). On the ASP version of the site, it works fine. It takes this path: http://mysite.com/media/#/ Game Music/FF3/Disc3/01 - New Continent.mp3 ..and outputs to the M3U: http://mysite.com/media/%23%5C%20Game%20Music%5CFF3%5CDisc3/01%20-%20New%20Continent.mp3 ..which Winamp is fine with. I found a function, urlencode, that sounded like it was the same functionality as ASP's escape. However, it creates this: http://mysite.com/media/%23%2F+Game+Music%2FFF3%2FDisc3%2F01+-+New+Continent.mp3 ..which Winamp does NOT like. Is there any way I can have it escape the string as ASP does? Thanks!
  2. Well, I have a piece of code that passes a file to a launcher. Right now in vbscript it looks like this: Set FS = CreateObject("Scripting.FileSystemObject") Set File = FS.GetFile("Some Random Video.avi") Shell.Launch "viewprogram.exe " & File.ShortName That runs viewprogram.exe and passes it "somera~1.avi". The "shortname" property is how I am getting the 8.3 format in vb. Is there something similar in PHP? I have a filename and I need to get the 8.3 format name of it.
  3. It's easy in VB with the filesystemobject, but I just started using PHP 5.2.6 under Windows 2003 server and alas I don't know the corresponding method in PHP. Thanks!
  4. Thanks guys. Man I feel stupid, banging my head against the wall looking at the php install when it was just bad code hehe. I noticed most of the tutorials I see are using mysql_ calls. Is the mysqli thing new or something? Do mysqli_ and mysql_ functions generally take the same parms or should I only be looking for tuts with mysqli? Thanks again, I really appreciate it!
  5. PHP version: 5.2.6 MySQL version: 5 ---------------------- I'm just learning php and decided to try to make my own version of a tinyurl.com like service. I have a form that collects the url to link to and the name to use for the shortened url then tries to write to a database. This is the code: echo "Creating new URL ...<BR><BR>"; $query = "INSERT INTO URLs (owner, sourceurl, tagname) VALUES (1, '" . $_REQUEST["sourceurl"] . "', '" . $_REQUEST["newtag"] . "')"; $db = mysql_connect(localhost,"username","password"); mysql_select_db("urls") or die( "Unable to select database"); $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); echo "New record inserted with ID ".mysql_insert_id(); mysql_free_result($result); mysql_close($db); When I run it, I get: Fatal error: Call to undefined function mysql_connect() in D:\sites\url\index.php on line 22 Now I did see the post here talking about how to fix it. I followed all the steps... I set the following things in my d:\apps\php\php.ini: extension_dir = "d:\apps\php" extension=php_mysqli.dll I made sure there weren't extra copies of the DLLs floating around. I copied libmysql.dll from d:\apps\mysql\bin to c:\windows\system32. I stopped and restarted IIS, but still no dice. In my PHP folder (d:\apps\php) I have the following files: install.txt license.txt news.txt php.exe php.gif php.ini php_mbstring.dll php_mysqli.dll php5embed.lib php5isapi.dll php5ts.dll When I installed php and mysql, it didn't give me any mysql stuff so I had to download that separately. However, I couldn't find php_mysql.dll. If I understood what I read (and that's not alltogether likely I guess hehe), php_mysqli.dll is the newer version of that so I downloaded it. Do I still need php_mysql.dll as well? When I went to the mysql download link and searched for "php", the only thing I could find was that mysqli. I did a Google for php_mysql.dll and found a dll download site with it, but not coming from mysql or php themselves I am kinda distrustful of it. PS, phpMyAdmin works fine which really perplexes me because to me, that indicates php and mysql are talking just fine. Ugh! 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.