Jump to content

Xtreeme

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Xtreeme's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you! Ah it works. Made me so happy to actually see it do just what I wanted for the first time. I cant tell you how great it is to have help like this. You saved me days of frustration looking at random google searches. Best of all I understand why its not working, and why the solution fixed it. I like learning not just being spoon fed. Folks here do that, they explain it. So great site, great people and great help! So thanks again thorpe, for taking time and helping folks like me out.
  2. OK, that clears that up. So what is the best solution. Can I give the full path in the file_exists command? It appears by this that it can be done, but not sure if Im reading it correctly. http://www.w3schools.com/php/func_filesystem_file_exists.asp Like this if(file_exists($_GET[mystuff/webpages'page'].'.php')) If not could I just remove the check for file code, without security issues that is?
  3. OK that works with a typical include. I added that to .htaccess and any include does default to the directory I set it to. But by trying to make it dynamic it breaks somehow. Im not good enough with code to see what Im doing wrong. This is what Im putting in the content div. The problem is with this code somewhere (Im sure its user error not the code itself) <?php // create an array of allowed pages $allowedPages = array('page1', 'page2', 'page3', 'page4'); // check if the page variable is set and check if it is the array of allowed pages if(isset($_GET['page']) && in_array($_GET['page'], $allowedPages)) { // first check that the file exists if(file_exists($_GET['page'].'.php')) { // If all is well, we include the file include_once($_GET['page'].'.php'); } else { // A little error message if the file does not exist echo 'No such file exists'; } } // if somebody typed in an incorrect url else { // if things are not as they should be, we included the default page if(file_exists('main.php')) { // include the default page include_once('main.php'); } else { // if the default page is missing, we have a problem and it needs to be fixed. echo 'main.php is missing. Please fix me.'; } } ?> Anything wrong with this code? Im getting the error 'No such file exists' so its not finding the include directory. But a simple include works......I have no idea why! My inlcude folder is two directories from root. mystuff/webpages for example. Like I said regular includes are working. However I want includes to change just the content div..........Im stuck. LOL. Thanks for all the help so far guys.
  4. not sure.... :-\ all I really want is to have the included file taken from somewhere else than root or where the index is. So if that code will do that, Im up for it! Any advice on how to do this is appreciated. Ill try that code now. Here is what I was trying to change home directory with. However Im just confusing myself, since I'm not really sure which is best way to achieve what I want. <? define("$home_path", "/mysite"); ?> But it was literally a stab in the dark. Now this code you gave me. It goes at top of page? Should it look like this set_include_path(/mysite) That is if mysite was a folder in root.... Thanks.
  5. Hi, got a new question. My goal: Have contents section of my index page dynamic. That is to have just the content div change when links are clicked (kinda like frames in html). This much I have gotten to work, as long as the included files and the index is in root folder of site. Which brings us to the problem. I would like to keep clutter down. So it would help to have all other included pages in a folder. Only the home index page will be in root folder. As I understand it, since Im using variables for dynamic content aswell. I have to declare the root as something else in index so that when the code calls for "root" it really goes to say /mystuff/webpages for example. Any ideas? Im following this guide for includes and variables. http://phpro.org/tutorials/Introduction-to-PHP-templating.html His code is working fine. However its all set to have included pages in the same directory as the index (all in root folder of site). Example of links <li><a href="<?php echo $_SERVER['PHP_SELF'];?>">Home</a></li> <li><a href="<?php echo $_SERVER['PHP_SELF'];?>?page=page1">Page One</a></li> <li><a href="<?php echo $_SERVER['PHP_SELF'];?>?page=page2">Page Two</a></li> <li><a href="<?php echo $_SERVER['PHP_SELF'];?>?page=page3">Page Three</a></li> <li><a href="<?php echo $_SERVER['PHP_SELF'];?>?page=page4">Page Four</a></li> as I understad it the PHP_SELF is what does this. Now I read something that said you could define a diff "home" path so that PHP_SELF points to a diff directory then server root. But must be declared at the beging of page. This is where Im stuck.....how do I do this. Ive tried on solution but the code didnt work right. Thanks in advance.
  6. If you still dont have this figured out. Try javascript to execute the flash file. I dont think that will harm your SSL. ITs worth a try atleast as its easy to do. Check my last post and link here.... http://www.phpfreaks.com/forums/index.php/topic,166970.15.html The key is to make a .js file with your flash code in it. This gets you around some of IEs "issues".
  7. thanks I used that in the actionscript as you said and it saved me from having to deal with it in this new method. Well, didnt want active content warning with flash header. So.....I kicked it up a notch (Emril Lagossi voice). LOL. I used a .js file to put the flash code in. Saved that to site root following this guide http://www.adobe.com/devnet/activecontent/articles/devletter.html Then put this code at top of page <?php session_start(); if($_SESSION['header'] == "yes"){ $show_header = "no"; } else{ $_SESSION['header'] = "yes"; } ?> <script src="header.js" type="text/javascript"></script> And where I want the flash to show I used <?php if($show_header == "no"){ echo '<img src="logo.jpg" alt="flash header" />'; } else{ echo '<script type="text/javascript">Runheader();</script>'; } ?> So thanks to all who replied since theres a bit of each of your contributions in there, with a dab of adobe tutrial aswell. haha. LoL its like code soup. Dunno if its "proper" code but it does work. If you see anything wrong with it, please let me know.
  8. OK after messing a bit more with it I got some code to work. I tried what you said and no go. The last one I actually had already tried just on a guess. But this code here works great. At begining <?php session_start(); if($_SESSION['header'] == "yes"){ $show_header = "no"; } else{ $_SESSION['header'] = "yes"; } ?> where banner goes <?php if($show_header == "no"){ echo '<img src="logo.jpg" alt="flash header" />'; } else{ echo '<EMBED SRC="logo.swf" WIDTH="600" HEIGHT="100" PLAY="true" LOOP="false" QUALITY="high" MENU="false" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"> </EMBED> '; } ?> works great and no loop. I even got rid of that right click menu (play, rewind, loop, etc.) Wanted to let others know in case they have similar problem (BTW works in IE6 and Opera)
  9. Alright this makes it work <?php if($show_header == "no"){ echo '<img src="logo.jpg" alt="" />'; } else{ echo '<embed src="logo.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="600" height="100"> </embed>'; } ?> One last question.........how do I include parameters like this? I need the no loop param for the flash. It seems to ignore it, if I just put it in before /embed This is the what Im trying to add to the embed part <param name="LOOP" value="false" /> So its 99% solved. Just that one nagging issue left, the no loop parameter. Sorry for being such a pain. My first .php site. Ive done phpbb but this is little diff, never used flash in php before. LOL.
  10. that makes sense in fact was first thing that came to mind cause its not a image at all (but google just confused me lol). I put the flash in just as before BUT it gave me two headers heh. The static one above and the flash one playing below it. I just removed the img source line, in dreamweaver put in the flash file as before, and then saved it to get that result. Maybe dreamweaver is putting too much code into that line (wrong code). Which appears to be the case. What is the best way to embed the flash file. It swf with actionscript in root of site aswell. Here is the mess of code Dreamweaver CS3 outputs when importing the flash file. Anything look fishy to you guys? <script type="text/javascript"> AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','600','height','100','title','Flash Header','src','logo','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','logo' ); //end AC code </script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="600" height="100" title="Flash Header"> <param name="movie" value="logo.swf" /> <param name="quality" value="high" /> <embed src="logo.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="600" height="100"></embed> </object></noscript> Thanks again guys Id be totally lost without your guidance (and this site gets a link on front page from mine LOL)
  11. O.K. that code works! yah! I have one issue Im sure is my fault. First visit not showing flash file just a x in a box (file not found?) When I refresh it DOES show the jpg now which is exactly what I want. My files are all in root which is drive w: (w:/logo.swf etc. etc.) flash file is named logo.swf jpg is named logo.jpg Here is the code Im using for test page- is it a flash thing now or a html/php thing Im overlooking here. <?php session_start(); if($_SESSION['header'] == "yes"){ $show_header = "no"; } else{ $_SESSION['header'] = "yes"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <?php if($show_header == "no"){ echo '<img src="logo.jpg" alt="" />'; } else{ echo '<img src="logo.swf" alt="" />'; } ?> </head> <body> </body> </html>
  12. Thanks guys! Im doing this right now. brb
  13. once last bump before I give up! definatly something wrong in that code I entered just as instructed. EVEN just that data in a .php file with no webpage info cause same error-syntax error. Either something is out of order, typo'ed, etc. Anyone that doesnt believe me enter this into notepad and save as .php (watch the results "syntax error") <?php session_start(); if($_SESSION['header'] == "yes"){ $show_header = "no"; } else{ $_SESSION['header'] = "yes"; } ?> <?php if($show_header == "no"){ echo "<img src=\"header.jpg"" alt=\"\" />"; } else{ echo "<img src=\"flashy_header.jpg\" alt=\"\" />"; } ?>
  14. I still cant figure that syntax error out I tried sever diff things. None worked. Its def in line 37 cause if I remove it, error goes away but of course it doesnt show the banner either. Any one have any ideas? ???
  15. Ya that was the flash trick I found but I got no where with it. The code had to be put in first frame of flash which I did (prob wrong though). I used windows > actions and put the code there while having first frame selected. replay = SharedObject.getLocal("save"); if (replay.data.name == undefined){ gotoAndPlay(2); replay.data.name = "played"; } else { gotoAndStop(424); } 424 is last frame (its 30fps). But the end result was no change at all. Im totally new to flash so......illustrator and dreamweaver is all I have experience with from adobe.
×
×
  • 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.