Jump to content

Submerged

Members
  • Posts

    22
  • Joined

  • Last visited

    Never

Everything posted by Submerged

  1. Here, try it, maybe you'll get a different result :) index.php[code]<html> <frameset rows="50%,50%">     <frame src="top.php" name="top">     <frame src="http://www.google.com" name="bottom"> </frameset>[/code] top.php[code]<? sleep(3); ?> <script> document.writeln(parent.bottom.location.href); </script>[/code] I added the sleep to make sure the bottom site loaded properly.  If you put a local file in the bottom frame (i.e. "bottom.php"), it does print out "bottom.php on the top frame.  With an actual site, such as http://www.google.com, it doesn't show anything.  Is this just a limitation of javascript, or something I've coded wrong?  Thanks!
  2. I'm not trying to set a location - I'm trying to find the location of the bottom frame.  Basically, I won't know what the URL is of the site in the bottom frame, so I am jsut trying to get the top frame to check the URL of the page in the bottom frame.  It seems like it should be simple, but I've been searching Google for a few hours and I haven't found the answer.  The above code works when its another page in my localhost, but if the bottom frame contains any site on a different server, it doesn't work.  That's what I'm asking about.  Thanks for any help :)
  3. That piece of code wasn't about assigning it to a variable, i was just trying to get it to print the location.  If i could get it to successfully do that, then I could get it into a variable without a problem.
  4. If you don't need it chopped off until the next page (if your submitting a form with it), you could use the PHP function "round", which comes with a way to leave a few desired decimals.  If you need an immediate change, I'm sure JS can do it, just not good enough with it to know how off the top of my head.
  5. Hmmm... I would have an onChange event in the drop down box, that would activate a function that would then fill teh other values (price, quantity) with the right values based on the new selection.  I'm not fluent enough to do that off the top of ny head, but that would work :P
  6. That solves the timing portion of it :)  But how would I even assign the location to a url?  I tried something like this: [code]<script> document.writeln(parent.bottom.location.href); </script>[/code] Which works, at least for a static page within my localhost where this runs on.  However, if I load the frameset with a website (I tested with 'http://www.google.com') in the "bottom" frame, it doesn't work.  Or, if I redirect from a local page (that normally works), to a real website, it also doesn't work.  I'm not sure why, or how to fix it.  Any ideas?  Thanks! PS. If I redirect to a different local page, it still works.  So I think it just gets screwed up when the bottom frame is a website on the actual internet, and not on my local server.  Which is odd, and I have no clue why that would be the case.
  7. One more quick question -  I have union working, heres the example I'm working with.  EDIT:  Never mind, I found it :)  Thanks for the help!
  8. It was a bit more than that, but since you told me about the union in the other thread i dont need this code anymore, thanks :)
  9. Shouldn't be tough to code - Get all the file names in an array (or, if all the files are in one place, use a glob function), then loop through it, putting each file into a string, using preg_replace or ereg_replace to replace the string you want, and then re-writing each file.  More info on the glob function here: http://www.php.net/manual/en/function.glob.php
  10. Hey, I was just wondering if there was a way to merge 2 mysql results into one, without just moving all the data to PHP arrays and doing it from there.  Thanks! -Alex
  11. It seems like this would be a common question, but searching through the forums hasn't turned up exactly what I'm looking for.  Basically, I have a table names "sites", and 2 of the columns in there are named "name", and "description".  I then have a query to search for a specific term. I have the query itself down just fine, when I'm just searching the "name" column: [code=php:0]SELECT * FROM sites WHERE name LIKE '%$term[0]%' AND name LIKE '%$term[1]%' AND category IN ('1','2','3','4','5','6','7','8','9')[/code] Which works just fine, but I also need to it to search through the "description" category in the same way as the "name" one (which includes the neccesary "category IN" part). I'm relatievly new to MYSQL, so I'm not sure how to process the syntax in that, but if someone could give me a hand it would be really great :) -Alex
  12. Heh... sorry.  Basically, I have 3 pages.  Index.php is just a simple frameset that splits the page into 2 horizontal frames, named "top" and "bottom".  The top frame shows the page "top.php", and the bottom shows the page "redirect.php". The twist is with the bottom page.  That page, upon loading, then redirects to a new page.  At that point (so, after a second or so for the new page to load), the top frame (top.php) needs to check the new location of the bottom frame, and put it into a variable.  It would be great if that js variable could then be put into a php variable somehow, but I could work it with either. I hope that helps, and thanks for looking :)
  13. Zoud, I was like you a while ago with no clue how to use MYSQL.  Now i at least have some ideas :)  I would suggest going to http://www.freewebmasterhelp.com/tutorials/phpmysql and learning to set up a basic address book.  It taught me a lot anyways.
  14. I have a basic frameset, "top" and "bottom".  I just need a script for the top window to wait about a half a second or a second, then check the location of the bottom frame.  I have a link that loads in the bottom half, then gets redirected, and the top page is then supposed to read where the bottom one went to.  Bonus points if you can get the URL into a PHP variable somehow :)  Thanks for the help, I'm not very good at js. -Alex
  15. Yeah, if the disclaimer page is disclaimer.php, then link to disclaimer.php?url=http://www.website.com.  Then create the variable via the GET method, like this: [code=php:0]<? $url = $_GET['url']; ?> Then just add it into the link, like so: <? echo "<a href=$url>$url</a>"; ?>[/code]
  16. Well, if you are going to redirect, i would just leave javascript out of redirect2.php and just go with a simple meta refresh: redirect2.php [code]<? $zip = $_POST['userzip']; $const1 = $_POST['const1']; $const2 = $_POST['const2']; echo "<meta http-equiv=\"refresh\" content=\"0;url=$const1$zip$const2\">"; ?>[/code]
  17. Hmmmm.. I was actually just about to post this question.  I think I could manage to do it using js, but it would be better to stay away from that if possible.  but can you do it w/o javascript, and without refreshing/redirecting the page prior to the end page link?
  18. Oh... lol, I had the category in there before, must've accidently deleted it while I was messing with the code.  But it was the use of apostrophies I really needed to see, and now it's working great so thanks :)
  19. This is mostly just because of AOL's spam filter... there are ways to get around it, but I'm not that well versed in it.  Most sites just tell visitors to add the sites email address to their white list to prevent it from being stopped.
  20. Hmmmm... well, assuming you are just doing a normal form to a php page, you could have a meta refresh on the second page that gets tripped if data is missing (etc), that would include all the current data witht he url.  Assuming the form page is .php.  There is also a way to send post data through a link, so you might be able to send it back without cluttering up the url bar.  It would also be good to include a variable to show which field is missing, so you can tell the user.  You would also have to have the gorm page insert the variables (GET or POST) into the form fields as their value. Does that help at all?  :) -Alex
  21. I think I am just messing up the syntax of the IN() function in this where clause: [code=php:0]<? $array[1] = '1'; $array[2] = '2'; $implode = implode("','",$array); $query = "SELECT * FROM `sites` WHERE IN '('$implode')' ORDER BY rating DESC"; ?> Query prints out as: SELECT * FROM `sites` WHERE IN '('1','2')' ORDER BY rating DESC[/code] It should print out several hundred entries from my database, and I've tested enough code with this script to know that the entries themselves aren't the problem.  It's just when I added the "IN()" part that it screwed up.  Probably something simple :)  Thanks! -Submerged
×
×
  • 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.