Jump to content

SJF

Members
  • Posts

    19
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

SJF's Achievements

Newbie

Newbie (1/5)

0

Reputation

  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
×
×
  • 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.