Jump to content

daniel244rock

Members
  • Posts

    20
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

daniel244rock's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. $createfile = "newfile.php"; $fh = fopen($createfile, 'w'); fwrite($fh, "<?PHP \n include_once(\$ram.\"db.php\")\n ?>"); I think that should work to write that file you were wanting. Lemme check it though. alright, now it works fine.
  2. Wolfrage! That function is completely sweet! I was wondering how to get the absolute path easily. I imagine I'll be using that one daily. Thanks... again.
  3. Interesting, and happily it makes perfect sense! So scripts on the server can access eachother anywhere they are, but a browser cannot have access to anything that is above the domain structure. Wolfrage: that is a sweet function! I have the site open now reading through the examples. Thanks! c_shelswell: Thanks, man. I'll be saving that script for later for sure. Mark: Thanks for explaining the obvious Now that I've seen it written out it makes perfect sense. Thanks all for your time. Daniel
  4. Wow! Thanks for the quick replies! While i'm reading up and trying those suggestions, I have another question. Isn't there a way to place some php file (i.e. db_connect.php) 'above' the domain accessible folder and still use 'include()' in a php file to use the file even though it is not accessible directly through the browser? can I make a folder called includes that is not accessible to the world, but accessible to server side scripts, or does it have to be completely available to all browsers? Thanks for the help so quickly! Daniel
  5. Hello! I am having a problem which I've never had before and can't find anything on it here on PHPFreaks, though I haven't read every thread so there might be somewhere, and I'm sorry if I'm duplicating anything. Here is a directory structure that we will use as an example: rootFolder - 755 fishing.png publicFolder publicFolder - 755 hiking.png error.php Lets say error.php contains the following code: <img src="hiking.png"> <br> <img src="../fishing.png"> When error.php is viewed in a web browser via the http domain (not locally, it works locally) only the hiking.png picture is displayed, resulting in the default browser empty image for fishing.png. If the properties are viewed for the empty image the path is "http://www.domain.com/fishing.png" (don't know if that has anything to do with the problem). I don't see why I can't use '../' to go back to the files I have stored in web inaccesible directories. If we move everything to publicly accessible locations and try the same page, it works as expected. Is there a php.ini setting that is messed up? maybe the include_path or something? I've played with that trying to get it working but maybe just messed it up more. Thanks in advance! If you need more info, I'll be here to answer questions promptly. Daniel EDIT: oh yeah, the domain points to publicFolder
  6. Good afternoon! So, I've been away for a few years, but I'm back and ready for some coding... except I'm pretty rusty. I've added a javascript/css popout menu (which works perfectly), and a google adsense feed, which also works perfectly. The problem is that the menu doesn't load until the adsense ads are completely finished loading. On slow connections it seems to take 10 seconds almost! Is there some way to have a javascript script run while other things are downloading? I've heard that some have used iframes for the google ads, but also read that it is not recommended and buggy sometimes. Maybe an AJAX script that would pop the google ads into a blank div after the page/menu is loaded and running? Would that work? Thanks in advance, I can post code if it is needed, I just don't know what would be needed to help. Daniel
  7. Oh yeah, and for anybody else who reads this that might need a bit more help, http://us3.php.net/mysql_insert_id should get you going, thanks again artacus
  8. Oh Yes!!  Flawlessly perfect function of goodness!! Thanks so much artacus, that was exactly what I was looking for. Daniel
  9. Wow, I've been doing the MySQL thing for years and haven't had to know that, so I didn't know that.  Thats really handy, thanks for the answer Cagecrawler and thanks for asking Patrickm. Daniel
  10. Hello! So I haven't had to post on PHPFreaks for Months and Months!! I must be improving, but obviously have a boatload yet to learn.  I have a script that copies a row from a database table into the same table, with all fields except the PK and a few others that are specific to the user entering the data.  The problem with this, is that the two rows (the one I copied from and the one newly created) are identical with the exception of the PK which is an auto-incrementing value.  I need to be able to update a few columns with the user-specific data but don't know how to select the newly created row.  It seems that there should be a way you can find the PK when you do an INSERT statement. For instance: Tablename : table PK : ID (Auto-increment) ---------------------------- |ID | name                       | ---------------------------- | 0 | Tommy                     | ---------------------------- | 1 | Timmy                      | ---------------------------- | 2 | James                      | ---------------------------- Then when you run "INSERT INTO table (name) VALUES (Jimmy)" have a way of getting the PK of 3. If I'm confusing, then thats normal.  I'll try to answer any questions you guys have about my descriptions. If its too much of  a dumb question, I'm not afraid to read some articles if you've got the links. Thanks tons in advance.  Daniel
  11. HaHa!!  That is perfect! Thank you so much for the excellent response.  My scripts meet all the criteria you listed and the solution worked flawlessly.  And so easy to update if I ever change hosts again. Thanks Ron Daniel
  12. I have a rather large project written, taking in about 200 pages.  Everything was working peachily.  Then I switched hosts to be on a faster server, but the new server is in a different time zone than my old one.  All my date() commands change to the next day at 10:00 PM, 2 hours ahead of schedule. Sadly, I didn't take this into account when I coded these pages or I could have put in a var that I could set and they'd all be updated. Is there a way I can subtract 2 hours from the server time sitewide?  Or do I have to go though each page and strtotime("-2 hours") each one?  Or is there another way to do this? Thanks much! Daniel
  13. Alright! So I added the clear:both; to the div, no difference. I removed the class from the div and it works consistently now. Do you know a site that explains why this happened?  I'm still not quite understanding how it would show up occassionally only.  Is it caching of the CSS?  Thanks so much, Daniel
  14. Hello and thanks in advance. I have a page I'm workin on (http://www.blogunique.com/lasaldan/index.php) which has me puzzled. All the text on this page is just filler text I threw in the DB so I could see sample text on the page.  You will see in the bottom left corner a space with the heading 'My cool books'.  Under this box is supposed to be a book review, which is recalled from the database. Now, the weird part...  If you see the book review below the title, then you are lucky.  Well, if you were me you would be.  On my screen the review shows up only about 10% of the time, but at completely random intervals.  Namely, if I hit refresh on the page, the review will be gone for 5 refreshes, then appear for 1, then be gone for 12 then appear again, etc.  When I view this page in FF it works mostly fine, meaning the book review appears, though occasionally it doesn't pick up on my external css (maybe thats a clue to whats wrong?). If you view the source code in IE, the book review is written there no matter what.  I've even md5ed the source code from a page that had the review showing and a page that didn't and the source is identical. I've also tried viewing with a different computer and even a different connection, both with the same results. I am out of ideas.  So, here are the facts in summary: [list] [*]Page loads properly in IE only 10% of the time or so. [*]Page source is the same whether it works or not. [*]Page loads in FF properly, with the exception of a dropped external stylesheet sometimes. [/list] Below is the code used to generate the book review: [code] <h3><strong>my cool books</h3> <div class="content"> <?php   $query = "SELECT * FROM books WHERE (client_ID='$clientID') ORDER BY date DESC";   $result = mysql_query($query);   $num = 1;   $i = 0;     while ($i < $num) {   $date = mysql_result($result,$i,'date');   $title = mysql_result($result,$i,'title');   $author = mysql_result($result,$i,'author');   $description = mysql_result($result,$i,'description');   $rate = mysql_result($result,$i,'rating');   echo "<p><strong>".$title."</strong> <br>&nbsp;&nbsp;-<i>".$author."</i> <br>".$description." Rating: ".$rate."/10. <br><b>Finished on: ".$date."</b><br></p>";   $i ++;   } ?> </div>[/code] Which outputs the following: [code] <h3><strong>my cool books</h3> <div class="content"> <p><strong>My fav Book</strong> <br>&nbsp;&nbsp;-<i>Marty Gerthory</i> <br>A great book that I just made up.  One of my favorites. Rating: 7/10. <br><b>Finished on: 2006-07-10</b><br></p> </div>[/code] So, I think the PHP code is working properly, as it is writing what it is supposed to, to the browser. What else might be the problem?  I'm sure I've forgot to write something that is critically important in this post (as I tend to do), so if you have any questions I'll answer quickly.  Thanks much for your time! Daniel
×
×
  • 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.