Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. 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.
  2. 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>
  3. 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?
  4. change this: $resursaTranzactii=mysql_query($sqlTranzactii); to this: $resursaTranzactii=mysql_query($sqlTranzactii) or die(mysql_error()); do you see any error messages displayed?
  5. 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.
  6. 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.
  7. can't even begin to help you without seeing how the rest of your page is setup, url structure, etc..
  8. Are you asking an actual question here (if so, then what?) or are you just venting frustration?
  9. Lies...it is obviously on line 42.
  10. 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.
  11. 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.
  12. 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.
  13. parse_url
  14. But you said exactly that... Sure, I'll agree with that. No it is not. Wrong. Wrong again.
  15. 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?
  16. 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?
  17. 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"; }
  18. lol, today's stupid quote of the day, thanks!
  19. 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
  20. so initialize $previous_category_name before the loop...error tells you what the problem is.
  21. to be clear, the problem is your quotes aren't lined up right. You start off with single quote, so if you have single quote as part of the value you need to escape it (prefix with a backslash) so that php knows you want to use a literal quote as part of the value instead of closing the string.
  22. compare the current category name with the previous category name and only output if it changes... // example loop while ($row = mysql_fetch_row($result)) { if ($row['category_name'] != $previous_category_name) { // echo category name } // echo sub stuff $previous_category_name = $row['category_name']; }
  23. A lot of times a script will have a "config" or "settings" variabe/object, or also a callback function that the script first calls or looks at when it runs, etc.. it's arbitrary, which is why you need to read the instructions that come with the script. For instance, if you have an image rotation script and the script works by updating an image tag with a new image src url, the script may allow you to specify the id attribute of the image tag and a list of URLs to rotate through, so it knows what image tag on the page to target and what images to display. init itself is not a special function. It is an arbitrarily named regular every day function just like any other javascript function. People just commonly use init as a naming convention specifically, because it is short, descriptive and intuitive in purpose.
  24. Unfortunately the more time we give, the greater chance there is of people retroactively deleting their posts because they don't like leaving "I'm asking noob question" paper trails. And since the point of this site is to provide a resource and help people learn, we don't allow for it. But then at the other end of the spectrum we have people who legitimately want to edit their posts for things like what you mentioned.. so it's a balancing act. We've experimented with shorter edit windows and longer edit windows and so far where it is currently at seems like a nice warm butter zone (though for sure, there is no perfect spot). If you find yourself in that situation feel free to report your post and staff can edit it for you.
  25. you can make an ajax request, as long as the file is on the same domain as the page requesting it
×
×
  • 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.