Jump to content

foochuck

Members
  • Posts

    82
  • Joined

  • Last visited

    Never

Everything posted by foochuck

  1. By default the music plays, that is set in the SWF object without a variable. On the pages where I don't want the music to play, I would just set that variable to false. The music plays by default. Is there any work around to control this?
  2. I'm running a regular PHP website. On the top of my page there is a flash object that plays music. You can toggle the music on or off with a flash button. By default, the flash music plays on each page, so if you were to turn the music off and then go to another page, the music starts playing again. I'm trying to set a cookie so that if a user turns the music off, when they go to another page, the flash player remembers whether to play or not. I am feeding a variable to my flash object called 'playMusic' which accepts either true or false. However I'm not sure how to have flash send a cookie to php if the button is turned off. Also I'm not sure how to set a cookie or if I should set a session for this. Any suggestions would be appreciated. -foo
  3. This should be easy but I can't figure it out. I have a string: $myString = "cr-charles-rob"; I want to remove the dashes ( - ) from the string so it looks like this: "crcharlesrob" What function can I use to accomplish that?
  4. I'm pulling the follwing line from an RSS Feed using PHP: <enclosure type="image/jpeg" length="60370" url="http://foochuck.com/pixelpost/images/20091218125438_img_0026.jpg" /> I'd like to replace in url the string "images/" and replace it with "thumbnails/thumb_". Do I use str_replace for this? If so, could someone show me a sample? Thanks -foochuck
  5. I'm using the function 'simplexml_load_file' Here is the code I'm using: <?php $featuredImgs = "http://foochuck.com/pixelpost/index.php?x=rss"; $xml = simplexml_load_file($featuredImgs); if (count($xml->image) > 0) { foreach ($xml->image as $node) { echo "<li><a rel=\"shadowbox;\" title=\"" . $node->title . "\" href=\"" . $node->description . "\" border=\"0\" alt=\"" . $node->title . "\"></a></li>\n"; } } ?> However this PHP code returns nothing. I'm wondering if I can't interpret $featuredImgs since that file is not an XML file, but rather a PHP file pulling in a variable. Is that correct & if so, is there a work around? If that's wrong, what am I doing wrong? I'm just trying to create an unordered list of items from the xml feed object. -foochuck
  6. What if I want to replace 'foo' with a variable? How would I put $foo into this line of code to replace the string foo: $imgCount = count(glob($dir . 'foo*'));
  7. I'm using this code to count images in a folder on my website: function countImgs() { global $imgCount, $folder; $dir = "./$folder/thumbnails/"; $imgCount = count(glob($dir . '*.jpg')); } Instead of counting all of the jpg's in the folder I want to count specific image sets in that folder. For example if my images are named: foo-01.jpg, foo-02.jpg, foo-03.jpg - I want to count all images that begin with the string 'foo'. Is this the correct way to check that? -> function countImgs() { global $imgCount, $folder; $dir = "./$folder/thumbnails/"; $imgCount = count(glob($dir . 'foo*')); } Thanks
  8. Hello, I developed a website using PHP5 and just found it's being hosted on a server using PHP4. Could someone let me know what the alternative to the function 'stripos' is in PHP4? Here is a sample of my code: if (stripos($_SERVER['SCRIPT_NAME'],'index') !== false) { $bodyClass = "homeBG"; } Thanks! foochuck
  9. Mark, FYI I came up with this code for #2 above and it does the trick... $path_parts = pathinfo($_SERVER['SCRIPT_NAME']); if (stripos($path_parts['dirname'],'portfolio') !== false) { $bodyClass = "portfolioBG"; } Thanks for your help.
  10. $folderName = explode('/',pathinfo($_SERVER['SCRIPT_NAME'],PATHINFO_DIRECTORY)); if (array_pop($folderName) == 'portfolio') { echo 'found portfolio<br />'; } I'm getting this error from the 2nd script: Warning: pathinfo() expects parameter 2 to be long, string given in /home/.backstitching/user/mysite.com/index.php on line 40
  11. Hey Guys, I have two more questions that go along the lines of this function / script... 1. I have several pages that are named: bio-1.php, bio-2.php, bio-3.php How can I detect if the string "bio" is contained in the name of the current PHP page? 2. I have a folder named "portfolio" with different pages in it just with random names - I want to detect if the pages are contained in the "portfolio" folder - can I do that with this script? Thanks FOO
  12. ahhhh...lol litebearer..I had an extra parens in there...t/y
  13. *bump* I'm trying to use this code: if (basename($_SERVER['SCRIPT_NAME'])) == "index.php") { $bodyClass = "home"; } and I keep getting this error: Parse error: syntax error, unexpected T_IS_EQUAL in /home/.backstitching/user/mysite.com/index.php on line 19 I'm not sure why I'm getting this, when I echo: echo basename($_SERVER['SCRIPT_NAME']); I get 'index.php' Any suggestions on what I'm doing wrong?
  14. Thanks Box, that comes in handy as well.
  15. Apache server is correct. Thank you Ryan.
  16. I'm working with two php files - index.php & news.php - I'm putting an include file in both pages. Inside of the include file I would like to write a line of code that will check to see if the page is called 'index.php' if it is, it will execute something. What function can I use to detect the name of the page? if(thisPage = 'index.php') { echo 'I am index.php'; } Thanks...
  17. It's all good man It's my fault...I try to explain what I'm looking for and end up leaving out some of the most important stuff.
  18. This method <?php if (a == b) { ?> HTML <?php } ?> will work the best for me...and yes I know how to do includes. Thanks everyone.
  19. I'm sorry I didn't explain to well...I'm using an if statement.... <?php if (a == b) { echo 'huge chunk of html goes here'; }
  20. I'd like to echo a huge chunk of html on my page using PHP...is there a way to echo html rather than using the echo function? FOO
  21. Someone just suggested this to me... if(strstr($myVariable,'the force')) { //It was found... } Would this work too?
×
×
  • 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.