Jump to content

Jeffro

Members
  • Posts

    156
  • Joined

  • Last visited

    Never

Everything posted by Jeffro

  1. thanks, ajrocker.. I think that did it! I guess that should have been obvious, but I honestly just rarely do php.. and only the minimal change here or there when I need it a few times a year. I thought the name in the url (testvar=) could be anything and was just used as an identifier while the get had to match the actual $variable from the prior page. Thanks much for the help.. and the print_r command! (jesirose). Handy!
  2. I'm definitely not good enough to help you out with the code... but if you decide to look to an alternative, I had the pagination problem just last week and after trying this pagination script.. it worked like a dream. Best of luck!
  3. Didn't realize I didn't put that here.. but yes, I had it in there. Okay.. to avoid confusion, here is a copy/paste of my test1.php and test2.php (only the domain name has been changed): test1.php: <?php $testurl = "mytest"; echo $testurl; echo '<br>'; ?> <a href="http://domain.com/test2.php?testvar=<? echo $testurl; ?>">test2.php</a> test2.php: <? $testurl = $_GET['testurl']; ?> <html> <head> </head> <body> <? if (isset($_GET['testurl'])) { echo $testurl; echo '<br>'; } else { echo "sorry dude"; echo '<br>'; } print_r($_GET); ?> </body> </html> And here is the output of test2.php: sorry dude Array ( [testvar] => mytest )
  4. (Sorry.. just updated. I was testing with 2 different pages.. basically both doing the same thing)
  5. That was some fast help! Okay.. this definitely helps.. but not quite sure what it means. I get this: Array ( [url] => http://google.com )
  6. I had an iframe working for the last few months on a site at hostgator. Yesterday, it quit working (403 permissions error). After a long bout of trouble-shooting, I found out that it has something to do with mod_security that they have suddenly enabled (have no idea as I'm not a Linux guy). They told me they fixed the problem on my domain by whitelisting it as an exception, but strangely, even though the permissions error went away, the actual src= box of the iframe, which was the url variable I was passing in the url, no longer loads. So.. I'm trying to break this down into the simplest form to figure it out. I just understand php basics so needing some verification that I'm doing this right/wrong. Here's my code.. page1.php <? $testurl = "http://google.com"; ?> <a href="http://mysite.blah/page2.php?url=<? echo $testurl; ?>">page2.php</a> page2.php if (isset($_GET['testurl'])) echo $testurl; else echo "sorry dude"; I am only able to print "sorry dude". Am I doing something wrong or shouldn't this send the url? Thanks for the help!
  7. Glad you hooked me up with that because I had to study it about 10 minutes to figure out what you were doing! It finally made sense and I stuck it in my script.. and voila! Works perfectly. Thanks so much. Really appreciate it.
  8. Since I don't know how many words they will use in the search, I would create an array, I guess? If so.. How do I then use that to search?
  9. Looking some more, I guess maybe I should post in the php forum? I'm guessing I need to somehow break $find into an array and then search each individual word?
  10. $find is the search my user types in a form. In searching mysql I want to search inventory.title and inventory.description ... and I want to return all results that have $find in either the title or description. I tried this: select * from inventory WHERE title LIKE '%$find%' or description LIKE '%$find%'"; That works for single words but if the user types in 2 words, I need it to look in title and description for any combination. Example: My user might type: miami truck I need to then perform a search where miami might only be in the title and truck might only be in the description.
  11. The links are created by the Amazon API I'm using.
  12. Hi all. So I was pretty proud of myself because for the first time ever, I actually figured out how to update the .htaccess file without asking for help. Here's what I added: RewriteRule albums/(.*)/(.*)/(.*)/ albums.php?language=$1&searchindex=$2&searchparameterdata=$3 that worked to translate my links to: http://www.my domain.com/albums/en/music/beatles/ But then.. along came pagination and I'm stumped again. On clicking my next page, it now appends to the above url like such.. beatles/?language=en&locale=us&page=2&searchindex=music&searchparameter=keywords&searchparameterdata=beatles& Is this something I can correct in my .htaccess.. keeping the format of my working url and still letting pagination work?
  13. Wow.. much easier than I had thought it would be. Many thanks!
  14. For all my urls, I'm needing to replace all numbers, letters and underscores encountered at the very end of all my urls with the word "title" The /ref= will always be at the end of the url (representing the last forward slash in the url) and there are always either (and only) numbers, underscores or letters after the = sign. Example: $myurl = "http:ljlkjlkjlkjl.com/category/date/ref=123_abc_de" would be: http:ljlkjlkjlkjl.com/category/date/title Thanks for any help. I still just have the hardest time with regex.
  15. I've always used this query but it no longer works: $data=file_get_contents('http://clients1.google.com/complete/search?hl=en&q='.$keyword); For more info, I posted about this here last year. Now, the query no longer works. Is there any other way to produce the results or is it just no longer going to work for me?
  16. $query=mysql_query('SELECT `email`,`name` FROM `users`'); //grab emails and names from database while($row = mysql_fetch_array($query)) //start a loop to send an email to each individual { //convert database rows to variables mail('$email', '$subject', '$message', null,'-finfo@yourdomain.info'); }
  17. http://codecanyon.net/searches?term=invoice&categories%5Bphp-scripts%5D=1
  18. Thanks! Seeing if I'm still indexed is actually the primary goal here so if I could accomplish what you said, it would serve the purpose perfectly. I've never messed with Google's API before.. I'm off to check it out....
  19. 'include.php' should work fine in connecting to the db. Now just google "php GET" to figure out the rest. include 'config.php' I meant. Where did my edit button go??
  20. 'include.php' should work fine in connecting to the db. Now just google "php GET" to figure out the rest.
  21. Create a 404 page. http://www.webweaver.nu/html-tips/custom-404.shtml
  22. Not sure if this is possible, but.. As most of you likely know, if a person searches Google, they can see how many webpages are indexed by using: site:techcrunch.com Is there any way that I could do this via a php script for 10 different sites and then have the results emailed to me on a daily basis? I'm not asking for a coded solution.. just an idea on how this might be achieved, if it could? Thanks.
  23. This kind of borders on php as much as mysql, but I think the mysql part is what's hanging me up. This works great in my php page: $query = "INSERT IGNORE INTO postings (title, description, timeStamp) VALUES ( '$title', '$description', STR_TO_DATE('$date', '%a, %d %M %Y %H:%i:%s'))"; So now.. for any new records, I want to compare the php $date against the mysql date (column called dateStamp with a type of datestamp). I tried adding this: $querycheck = "SELECT 1 FROM postings WHERE city='$city' and STR_TO_DATE('$date', '%a, %d %M %Y %H:%i:%s') > timeStamp LIMIT 1"; if ($querycheck === true) { $query = "INSERT IGNORE INTO postings (title, description, timeStamp) VALUES ( '$title', '$description', STR_TO_DATE('$date', '%a, %d %M %Y %H:%i:%s'))"; mysql_query($query) or die( "<br>Query string: $query<br>Caused error: " . mysql_error() ); } It seems to be evaluating the expression because.. if I run my php 2x in a row, it inserts about 20 dates the first time.. and 0 the second time. The problem though.. I'll then order by dateStamp desc for that city only... delete the highest date, rerun my php page and it still inserts 0 results, even though $date is higher than any other result in the mysql table at that point. Any ideas?
  24. Nevermind.. got it. $string = rtrim($string, '-'); ....seems to do the trick.
  25. I know this one is probably super easy for you programmer types.. but I just need to know.. If a string ends with a dash (and not all of them will), how do I remove it? Thanks!
×
×
  • 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.