Jump to content

ToonMariner

Members
  • Posts

    3,342
  • Joined

  • Last visited

Everything posted by ToonMariner

  1. remove the £ from your database and leave it as an integer OR change it to a decimal data type and you can store it as 9949.75 then!!!! use number_format(); to format the output of your scripts
  2. put the data into anchor tags and set the urls using all the data you need.
  3. Hi people. I am having a little problem. I have a file download script that is working fine (for most users) but some report that the dialouge box that allows you to choose open or save (and subsequently pick where to save) is not displaying. The download begins automatically and users cannot find the file on their machines. I have just managed to replicate this in IE7 and it is a bit annoying!!! ;) Avant (using IE7's engine) works ok. IE6 with pop-up blocker installed has the same problem when you allow pop-ups from this site otherwise it blocks the pop-up. here is the download file.. [code]<?php $error = NULL; $filename = isset($_GET['file']) ? $_GET['file'] : NULL; if ( ini_get('zlib.output_compression') ) { ini_set('zlib.output_compression', 'Off'); } $file_extension = strtolower(substr(strrchr($filename,"."),1)); if ( is_null($filename) ) { $erro = "Error: No file path passed to script."; exit; } else { $first_char = substr($filename,0,1); if ( $first_char == "/" ) { $filename = substr(strtolower($filename), 1); } if ( !file_exists($_SERVER['DOCUMENT_ROOT'] . "/" . $filename) ) { $error = "Error: No such file found."; exit; } } switch ($file_extension) { case "pdf": $ctype = "application/pdf"; break; case "exe": $ctype = "application/octet-stream"; break; case "zip": $ctype = "application/zip"; break; case "doc": $ctype = "application/msword"; break; case "xls": $ctype = "application/vnd.ms-excel"; break; case "ppt": $ctype = "application/vnd.ms-powerpoint"; break; case "gif": $ctype = "image/gif"; break; case "png": $ctype = "image/png"; break; case "jpeg": case "jpg": $ctype = "image/jpg"; break; default: exit();; } header('Pragma: public'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Cache-Control: private',false); header('Content-Type: ' . $ctype); header('Content-Disposition: attachment; filename="' . basename($filename) . '";' ); header('Content-Transfer-Encoding: binary'); header('Content-Length: ' . filesize($filename)); readfile($filename); exit(); ?>[/code] PS As a side I would dearly love to get the downloads working as they do from download.com instead of this pop-up being the driving force.  How can you achieve a download that is NOT affected by the pop-up blockers (or should I say what other method are available that could combat this issue.)
  4. christ that header gif is annoying! take the inifite loop off!!!!! Well lets start with your html. You hve only gone and doen this in front page. so it will stuff in that only functions in IE.... Where possible keep all your style in a separate style sheet. Don't use tables for layout - it makes your file size absolutely enormous (wasting bandwidth and slowing your site down).  There is so much trash to trawl through there that its difficult to point you in the right direction (apart from start again) although bear in mind that style is inherited so if a parent element has central alignment and you don't declare any different for the child that will align centrally too.  This points me to the opinion you have some style that only IE or FF recognizes as they are not rendering alike. Good luck and come back when you need some more help.
  5. $_SERVER['HTTP_REFERER'] may not nessesscarily be sent by the client or can be set (depending on client). The session thing could work but i'd have to unset it each time just in case they tried to leave a window open and use that as a gateway. Gonna have to make sure I get the old logic right on this - it is critical
  6. OK I have posted this in the ajax forum but its pretty quite so I'd liek to see if anyone in here has any ideas. I have a php script called via an ajax request.  I want the script to ensure it has been called by this request and NOWHERE else; i.e. nobody could type the url in or even script a bot that would send a request to this script automatically. I really need to restrict script running JUST from the ajax request on my site. ANY ideas will be much appreciated.
  7. OK I am sure this is straight forward but I am struggling to find a solution. I have a php script that is called from an ajax request.  I want to make sure that this script can only be called by that ajax request and NOT by someone reading the url and either putting it in the address bar or worse using some kind of bot to call this script automatically. So basically the php script HAS to check that the call for it to run was from the ajax request and NOWHERE else.
  8. remove teh first $row=mysql_fetch_array($query) OR use mysql_dataseek to get back to the 0th record.
  9. ie 7 supports :hover on all elements and i guess pretty much everyone with ie6 will upgrade within the nxt couple of months - after all theres no reason not to. Better to not have javascript alter the pages design - just leave js for effects and data checking etc etc. Keep the 'look' of your site to css and you'll have a forwards compatable site that won't break when a new version of the standards compliant browsers are released.
  10. I prefer hypnos method - I break out of php for html pretty much all the time. Only when I have somnething liek echo "<p>foo bar</p>"; do I not bother.
  11. make sure you have the curl extension available.
  12. you are also relying on js being on! admittedly this true the majority of the time but you should deisgn your site so that it doesn't need js and then add that on as an improvement for the vistors experience.
  13. ???? The host name has to be the host of teh database - otherwise you'd never know where you are connecting to. There is the potential that the hosts of the database you are trying to connect to do not allow access from outside the server. BUT be absolutely sure you have the correct host name. You may also have to specify which port to connect on.  Get in touch with the hosts of teh database you are trying to connect to and ask them exactly what details you need to connect remotely to the database.
  14. griffin is indeed an index on the array but peter is not - its a value. so to get Peter you'd need $families['Griffin'][0]
  15. I know of no time zones that are 3 and a half hours from gmt they are all +/- integer hours
  16. the majorissueyou have here is secure storage of details. Essentially if you successfully completed the transaction once then you can do so again with all the same details, bar aunique transaction id. You will have to encrypt a field on the database that only you can decrypt.
  17. you sohould not use text-align to centre block level elements. In order to get margin: auto to work in centering a page the parent container must be given some width - either % or fixed width.
  18. simply echo the url into the href attribute of the a tag!
  19. ask your web space provider for the correct host details - they may also be security preventing connection from external servers - email them and see what they say.
  20. Good tool for css authoring [url=http://www.newsgator.com/NGOLProduct.aspx?ProdID=TopStyle]http://www.newsgator.com/NGOLProduct.aspx?ProdID=TopStyle[/url] It is worth getting the pro version (IMO). Good couple of features like checking validity against browsers or standards etc. etc. and really helps you manage your style sheets; see all your selector-class-id declarations and helps create your css very quickly.
  21. did ur site look the 'same' in ie6 as it did in FF? What is your doc type?
  22. [code] <div id="header"> <img src="images/logo.jpg" id="left" width="305" height="74" alt="logo" /> <img src="images/2.gif" id="right" width="400" height="73" alt="2" /> </div> [/code] [code] #header{ width: 760px; height: 76px; background: #EDF2F6; } #header #left { float: left; } #header #right { float: right; } [/code]
  23. [url=http://css-discuss.incutio.com/?page=ThreeColumnLayouts]http://css-discuss.incutio.com/?page=ThreeColumnLayouts[/url]
×
×
  • 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.