Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. but is $dots javascript or php? I'm going to assume it is supposed to be some kind of php callback function to reformat the url...so there is a placeholder function in script below. $list = array( 'cars' => array( 'Car 1', 'Car 2', 'Car 3', ), 'trucks' => array( 'Truck 1', 'Truck 2', 'Truck 3', ), 'motorcycles' => array( 'Motorcyle 1', 'Motorcyle 2', 'Motorcyle 3', ) ); function dots($url) { return $url; } ?> <div id="left-nav"> <?php if ( isset($leftnav)&&isset($list[$leftnav]) ) { ?> <ul> <li><h3><?php echo ucfirst($leftnav) ?></h3></li> <?php foreach ($list[$leftnav] as $k=> $link) { ?> <li><a href="<?php echo dots($leftnav.'/model/'.$leftnav.'-'.++$k.'.php'); ?>"><?php echo $link ?></a></li> <?php } ?> </ul> <?php } ?> </div>
  2. what is $dots(...) supposed to do? Is that supposed to be javascript or php?
  3. This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=359991.0
  4. I suggest you go to a wordpress theme developer site to ask this sort of question. People who specifically develop wordpress themes may be able to better point you in the right direction as far as what file(s) you need to modify. Or hire someone to do the work for you. There's certainly nothing we can really help you with, just going to your site...
  5. captcha does require extra coding, yes. Usually captcha works by generating an image with words, letters and/or numbers in a randomized styling so that bots can't read it. The visitor then has to enter in what is displayed. If the visitor fails to enter in the text, your script assumes it is a bot and stops whatever process happens when you normally do a form submission. Another form of captcha is to output a question that a bot can't easily answer. For instance "What is two plus two?" or "What is the third letter of the fourth word in this sentence?" There are a lot of 3rd party captcha scripts out there that are relatively painless to install, just hit up google. One popular one is reCAPTCHA because it has the added benefit of helping digitize books out there. The idea is that there are a lot of printed items out there that people want to digitize, but the printing is too hard for scanners to read, so people have to manually look at it and enter it in. Well the idea is that this makes for perfect anti-bot protection..well, you can visit the site and read the details yourself. It's a neat concept. There are also other anti-bot things you can do, other than a captcha system. One thing you can do is setup a honeypot. Bots are kinda stupid and basically attempt to fill out all fields in a form. The idea of a honeypot is to add a fake form field on your form that the a visitor will not fill out because they will not see it (hide it with css, etc...). The bot won't see that it's not meant to be seen, and happily fills it out with info about viagra or whatever. You would then basically tell your script to stop form processing if this dummy form field is filled out. Another method is to time the form output vs. form submission. If you have a form that normally takes a few minutes to read and submit, and you see that it is being submitted less than a second after it was requested, then it is more than likely a bot. Implementing this involves outputting a token as a hidden field for the form and keeping track with a session variable, db table or flatfile, the token value and the timestamp. Then upon form submission, you check the time submitted vs. time output, based on the token submitted. If the token doesn't exist or if the time is too short, assume it is a bot and stop processing the form.
  6. Well i told you why it probably isn't opening in IE. IE is trying to download it as a downloadable item. 99% sure this is because whatever services.php is doing, it is returning the result in a format IE doesn't recognize: eg: malformed response headers, etc.. IOW the problem is with services.php script. If you can't show me the code to services.php then there's nothing I can do to help.
  7. The error is because you are looking for individual variables like $cars, $trucks etc.. but you only define one of them at a given time. Instead of defining individual variables with a value of true, a better method would be to define a single variable with individual values like 'cars', 'trucks' etc...and then output based on the value of the single variable: "corresponding page" <?php $leftnav = 'cars'; include('../inc/left-nav.php'); ?> left-nav.php <?php $list = array( 'cars' => array( 'Car', 'Car 1', 'Car 2', 'Car 3', ), 'trucks' => array( 'Truck', 'Truck 1', 'Truck 2', 'Truck 3', ), 'motorcycles' => array( 'Motorcyle', 'Motorcyle 1', 'Motorcyle 2', 'Motorcyle 3', ) ); ?> <div id="left-nav"> <?php if ( isset($leftnav)&&isset($list[$leftnav]) ) { ?> <ul> <?php foreach ($list[$leftnav] as $link) { ?> <li><a href="#"><?php echo $link ?></a></li> <?php } ?> </ul> <?php } ?> </div>
  8. where are you actually connecting to your database? Do you have a mysql_connect() and mysql_select_db() somewhere above the posted code? Is the posted code within a function and your connect/select_db in some other function or outside of the function?
  9. change this: $resursaTranzactii=mysql_query($sqlTranzactii); to this: $resursaTranzactii=mysql_query($sqlTranzactii) or die(mysql_error()); do you see any error messages displayed?
  10. right, we've already established that... you didn't answer my questions To be clear, show some code in services.php, particularly the bits that actually output those values.
  11. What exactly does services.php do? how is "KO" or "OK" being output? At face value, it seems as though you are trying to output something in a nonstandard or unknown format without outputting proper headers, and some browsers are "best guessing" or defaulting to html or something, while others aren't.
  12. can't even begin to help you without seeing how the rest of your page is setup, url structure, etc..
  13. Are you asking an actual question here (if so, then what?) or are you just venting frustration?
  14. Lies...it is obviously on line 42.
  15. echo just echoes whatever value you give it, it has no method or argument for limiting the length of the value. You can wrap your value in a substr call to limit it.
  16. It would help if you posted some relevant code, but to provide more detail, you are using a function such as date or strtotime that doesn't recognize the datestring or timestamp value you are giving it, so it is returning 1/1/1970 (in whatever format, depending on your script). That date is the starting date of unix time.
  17. You can't really load a remote file with GET variables using jquery (javascript) as this is considered cross-site-scripting (XSS), so you will have to make the request and receive the response server-side. Depending on how the remote server/script is setup, you may be able to just use file_get_contents. But if the remote server/script has some kind of barrier (like detecting and rejecting unless it detects browser headers, needs cookies, etc...) then you will have to use [m=curl]cURL[/m] so that you can set headers, make use of cookies, or whatever other hoops you may have to jump through to handshake with the remote server/script.
  18. parse_url
  19. But you said exactly that... Sure, I'll agree with that. No it is not. Wrong. Wrong again.
  20. I see nowhere in your script where you actually connect and select a database...you should have a mysql_connect and mysql_select_db in there before your query. Did you not post that part of the script, or do you really not have that in your script?
  21. 1) did you echo $comments to see if it contains expected value? 2) do you have a comments column in your db table? 3) Is the question being inserted okay, just not the comment?
  22. switch($_GET['foo']) { case 'bar' : echo "foo is bar"; break; case 'something' : echo "foo is something"; break; case 'blah' : echo "foo is blah"; break; default : echo "foo is something not listed in the cases"; }
  23. lol, today's stupid quote of the day, thanks!
  24. query string parameters passed to your script can be found in the $_GET superglobal array. Example: http://www.somesite.com/somepage.php?foo=bar echo $_GET['foo']; // output: bar
  25. so initialize $previous_category_name before the loop...error tells you what the problem is.
×
×
  • 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.