Jump to content

SJF

Members
  • Posts

    19
  • Joined

  • Last visited

Everything posted by SJF

  1. PERFECT!!! The reason I need this is because I need a notification saying if someone is currently on the page or not (not like a counter, but simply an "occupied"). So for instance... if I visit the page, and no one else has it open, it will say "Available". And if, while I am on that page, someone else visits the same page (or, to test, I could visit in another browser/window), it would say "occupied". is this possible? Thanks again for your help!
  2. This concept is so simple yet I can't find anywhere that says how to do it. The premise is simple: A switch that says "on". When you click it, it says "off". The key is, anyone can visit the page, and see this, click it, and it can change. Thus it has to be some sort of database or something. One very jimmy-rigged thing I tried (but failed) at doing was this: <?php $myFile = "test.txt"; $fh = fopen($myFile, 'w+'); $theData = fgets($fh); if ( $theData == "on" ) { echo "on"; $stringData = "off"; fwrite($fh, $stringData); fclose($fh); } else { echo "off"; $stringData = "on"; fwrite($fh, $stringData); fclose($fh); } ?> and in test.txt I have "off". This way, if the site is visited, it checks to see the text file's content says "on", if it does, it echos "on", then is SUPPOSED to set the text file content to say "off", but for some reason it's not writing back to the text file. Anyway there has to be a simple way to do a simple toggle button. Thoughts?
  3. Yea it's all good. I won't need comments, etc. It's just for content managing. Thanks again! You might be interested in this site - www.chipin.com maybe put it on your signature? People can give you money for thanks! Haha, instead of a "buy a drink" button! I'll throw a couple dollars your way!
  4. I ain't kiddin' when I say you're an effin genius. It worked perfectly. Thank you! Now I owe you 2 drinks!! edit: (topic solved - for now! haha and hopefully forever!)
  5. Hmm alright, thanks, I appreciate it!
  6. Interestingly enough, when I test this on another server with another site I did, and used the original include (which works fine on that server) it works fine when including two pages. This is what works, to show both pages, on the previous site. <?php include("http://www.theirsite.com/content/?p=95"); ?> <?php include("http://www.theirsite.com/content/?p=228"); ?> But when I do the same exactly thing with the code you gave me... via: <?php $_GET['p'] = 95; $WPdir = dirname(__FILE__)."/content"; chdir($WPdir); include($WPdir."/index.php"); ?> <?php $_GET['p'] = 228; $WPdir = dirname(__FILE__)."/content"; chdir($WPdir); include($WPdir."/index.php"); ?> ...it doesn't show the second included post. So somehow the code you gave me and the one that is working isn't matching to call the same things from the server. Quick question, since I'm a newb at PHP here, when the URL says "?p=228" at the end of it, the only way of calling that variable p is via a $_GET? I'm just trying to narrow it down. Hope this helps some. (I can not link since I don't have their permission to)
  7. Yea, just as a quick debug mode, I've set up www.toyrecruiter.com/include.php with the following code inside: <?php $_GET['p'] = 3; $WPdir = dirname(__FILE__)."/content"; chdir($WPdir); include($WPdir."/index.php"); ?> <hr /> <?php $_GET['p'] = 8; $WPdir = dirname(__FILE__)."/content"; chdir($WPdir); include($WPdir."/index.php"); ?> Because each include is going to be in a different DIV on the page, take this example as simply debugging. The second include doesn't do anything. It just doesn't bring the post in at all. Edit: Doing more than one include seems to work if I just pull in a simple PHP file twice, so I'm guessing it has something to do with the way the variables are. It must not like me trying to bring in two pages at once.
  8. Ok cool, I swapped out all of the code. But still nothing appears after the very first include. I'm wondering if it is because I'm including the same index.php file but with different variables for p in different places on the page... Any thoughts?
  9. Here's something I attempted after doing a bit of research. What it is doing is trying to find the directory "content" within the folder "content" since it is already inside the directory "content". So, I found that if before you ever call chdir('directory') if you put $cwd = getcwd(); it will save the current directory, which then you can come back to it. So I did this code: $cwd = getcwd(); $_GET['p'] = 3; chdir('content'); include(dirname(__FILE__)."/content/index.php"); chdir ($cwd); So as you can see – it brings PHP back to the directory it started in, so the next include I simply have to put the same code (change the 'p' value), keep the chdir the same, include the same way, and at the end "reset" the chdir by using chdir ($cwd); I've done that, and now nothing shows up at all. Not even an error. So I echoed $_GET['p'] and it reads 3 the first time, and on the second include (when I change the value) it reads 8, how it should, etc. When I echo getcwd(); it echos fine (in the root, where it should) or in content if I echo after chdir ('content'). So now I'm baffled. Any thoughts?
  10. Ugh... ??? hold the phones. When I try adding that code for multiple posts on one page it gives me this error: [pre]Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /home/content/g/r/e/greattoysearch/html/toyrecruiter/index.php on line 160[/pre] See www.toyrecruiter.com for where the errors are appearing and what I'm trying to do... Think you can help me out one last time?
  11. It worked!!! You're a genius! Too bad you don't live in the US, I'd buy you a drink! Thanks SO much for your assistance.
  12. I get the following error: [pre] Warning: require(./wp-blog-header.php) [function.require]: failed to open stream: No such file or directory in /home/content/g/r/e/greattoysearch/html/toyrecruiter/content/index.php on line 17 Fatal error: require() [function.require]: Failed opening required './wp-blog-header.php' (include_path='.:/usr/local/php5/lib/php') in /home/content/g/r/e/greattoysearch/html/toyrecruiter/content/index.php on line 17 [/pre]
  13. Did that, and have done that. It didn't have a PHP.ini file or a PHP5.ini file so I made both and uploaded it, and still nothing. So what I did was a little research and stumbled upon this page: http://help.godaddy.com/article/1409 It talks about how to edit the PHP.ini file via SSH - but it's for dedicated server, while this is a shared one. So I did that whole special request for access to SSH, and it is running setup now. I'm guessing Apache restarts every 24 hours so hopefully within 24 hours it will read my new php.ini file and just reapply it with the _fopen settings.
  14. Alright, this sounds like it might work. Thanks for looking into that. Now I just need to know how to do one of two things... 1) How to restart apache. or 2) how to edit the php.ini file directly on the page and hit some sort of "save" button so it automatically restarts apache. I'm looking for either one now.
  15. Ok. Would remote file access have anything to do with: [pre]allow_url_fopen = on allow_url_include = on[/pre] ? If so, is there a way to edit the .htaccess file to point to my local PHP.ini and use that instead of the main one (GoDaddy's) that it's probably using? Or is there another line of code I should put in my ini maybe? Here's my PHP ini file code: register_globals = off allow_url_fopen = on allow_url_include = on expose_php = off max_input_time = 60 variables_order = "EGPCS" extension_dir = ./ upload_tmp_dir = /tmp precision = 12 SMTP = relay-hosting.secureserver.net url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset=" [Zend] zend_extension=/usr/local/zo/ZendExtensionManager.so zend_extension=/usr/local/zo/4_3/ZendOptimizer.so
  16. MadTechie - I appreciate it, I really do. However, both codes you provided are not working and are giving the same error. Here is what I'm trying to achieve in a nutshell, so that you have a greater understanding. In Wordpress, you can create posts. Each post is a link, just as I have included there (http://www.toyrecruiter.com/content/?p=3). If you go there and go ahead and view the source you'll see it's just HTML code. This is so that the client, in the future, can edit the content on that part of the website via editing the Wordpress post. So basically I am using Wordpress as a CMS, putting editable regions where I want them. Does this make sense? As I said before, it works fine on other pages. It validates fine. It works fine with SEO. I'm just not sure why it's not working with GoDaddy's service, versus my other service.
  17. Urls like ?p=3 is non seo friendly. Point taken. That's why I'm not using those URLs in the actual site. The actual site is www.toyrecruiter.com - check it out to see the error I'm referring to. You can see, for the top content I'm using a PHP include from the wordpress post (the ?p=3 you are referring to). I have other websites where this works 100% perfectly fine, so my question here isn't "is this good design" or "is this SEO friendly". My question is why doesn't it work on this GoDaddy server, when it works fine on my HostMonster server?
  18. Sorry I forgot to put that I tried this. It doesn't seem to work either. All due respect, but I honestly don't see it as a bad design. All I am doing is taking a single wordpress post and stripping it down to pure HTML code and then somehow taking that data and plugging it where you want to on a site (so that the client can later update the page whenever they want). The fact is that it has worked in the past (and as you can see, still works from sjf.me including it) so I'm not sure why it's not working otherwise. Also, what would you suggest as a solution otherwise, if the include is "bad design" in your opinion?
  19. Hey guys! Brand new to the forums, so first of all I'd like to say thanks for taking time to read this! I'm broken this down as basic as possible for assistance. The Code that is in both links (include.php) below: <?php include("http://www.toyrecruiter.com/content/?p=3");?> The Error [pre]Warning: include(content/index.php?p=3) [function.include]: failed to open stream: No such file or directory in /home/content/g/r/e/greattoysearch/html/toyrecruiter/include.php on line 1 Warning: include() [function.include]: Failed opening 'content/index.php?p=3' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/content/g/r/e/greattoysearch/html/toyrecruiter/include.php on line 1[/pre] The Situation I'm using PHP includes to pull string data from a single Wordpress post so I can place it anywhere on the page. I've done it with multiple sites in the past with absolutely no problem. Working vs Non-Working Examples Working: http://www.sjf.me/include.php Non-Working: http://www.toyrecruiter.com/include.php Other Forum's Solutions Other people have had similar issues and here are some of the solutions they provided: Did this. And I've saved it as both PHP.ini as well as PHP5.ini (since that's what they said to save it as if you have PHP5 installed). I -can- downgrade to PHP4 (GoDaddy allows me to do this) but I have not tried this. Did this. They claim everything is fine on their end. I even asked why it works when I link to their server (toyrecruiter.com) via my other server (www.sjf.me - hosted through HostMonster) and still they say the PHP is working fine. Didn't help at all. Did this. It does not work for me. I'm not sure why, but basically it shows up completely blank as if it wasn't bringing the data into the variables or something. Not to mention, there is no reason I should have to go this route if it is working perfectly fine on another server. I have not done this, but if anyone can point me in the right direction to do this, or feel it might solve the problem, please do! I'm at a complete loss. This website is for a client, and they have already paid for hosting from GoDaddy for a while so switching hosting services is not a choice (or at least not one I think they'll want to do). www.sjf.me is hosted with HostMonster.com with PHP 5 www.toyrecruiter.com is hosted with GoDaddy.com with PHP 5 Thanks again for taking the time to read this and hopefully someone has a solution! Happy 4th of July!
×
×
  • 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.