-
Posts
1,008 -
Joined
-
Last visited
Everything posted by spiderwell
-
hi all, i have researched this, and tried many variations to get this to work but it just doesnt seem to like it. I hopeing there is someone here who can fix this for me. I am writing my own mvc system, more as an exercise than anything . i use rewrite to pass everything through the same file. that was all working fine. <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?url=$1 [PT,L] </IfModule> i wanted to add a rewrite for admin calls to go via a specific directory getting re written to a file called admin.php. so to try and put in layman terms any call starts with www.mysite.com/a/ goes to www.mysite.com/admin.php and anything else is covered by the original rewrite rule. i tried this but it only seems to break it <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(a/.*) admin.php?url=$1 [PT,L] RewriteRule ^(.*)$ index.php?url=$1 [PT,L] </IfModule> i spent ages on this and i know some genius out there can crack it for me in 5 mins! thanks and HNE!
-
the statement sets the first_name field value to that of the name field value, you dont need to get it
-
i thought the same when i saw the title, then i starting thinking of making an web app with drag and drop elements from the periodic table to create compounds, to what end i wasn't sure
-
Hi all I am really gonig mad trying this out, I have a folder which file uploads are in, and only want them to be downloadable via access from one php file, which also resides in the same folder. its a basic php forcedownload script. I dnot want the files to be able to be accessed by typing them into the browser (i have already hidden the file names, and added checks for logged users). My efforts have seem to be all or nothing, i.e cant access anything in the folder or you can anything. i had this in the top of the htaccess: # disable directory browsing Options All -Indexes which wouldnt let me access the php script that downloads the files (the php download script is called by updating the src of an iframe via ajax, I am using an iframe hidden to trigger the force download) if i delete the htacess it works fine but then no security. I tried adding this to the htaccess and it didnt work either: AuthUserFile /dev/null AuthGroupFile /dev/null RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://www.ethickink.co.uk/geoline/.* [NC] RewriteCond %{HTTP_REFERER} !^http://ethickink.co.uk/geoline/.* [NC] RewriteRule /* http://www.ethickink.co.uk/geoline/pages/index.html [R,L] I really am not understanding htaccess very well :'( any help would be much appreciated
-
Microsoft acquires Skype - but what else do they own!!
spiderwell replied to titan21's topic in Miscellaneous
i like the fact when you install skype it still offers your google chrome as a browser (well it might have been firefox actually), even though its owned by microsoft -
php variable error, with this cookie code.
spiderwell replied to antonyfal's topic in PHP Coding Help
its good to know it got resolved -
php variable error, with this cookie code.
spiderwell replied to antonyfal's topic in PHP Coding Help
does this line need the single quotes? if(!isset($_COOKIE['$cook'])) -
hard to tell really what is value of $maxrecords? in the sql bit for no search entry. also perhaps something breaks in the CalculateTax function, have you got the code for that?
-
force download script failing with PDFs.
spiderwell replied to spiderwell's topic in PHP Coding Help
mmm that didnt work either, i will i think strip out the stuff above and have another go and work backwards from having just the force download and re add the logging bits to see if that makes any difference -
force download script failing with PDFs.
spiderwell replied to spiderwell's topic in PHP Coding Help
this was where i took my script from! lol. I will have another try with this. -
force download script failing with PDFs.
spiderwell replied to spiderwell's topic in PHP Coding Help
it didnt work this is most annoying!! lol -
force download script failing with PDFs.
spiderwell replied to spiderwell's topic in PHP Coding Help
i will give it a go!! -
force download script failing with PDFs.
spiderwell replied to spiderwell's topic in PHP Coding Help
no one got any ideas? -
Hi guys This one has been trouble for me for a qhile now, and I have tried various methods and none seem to work on pdf downloads, the file downloads only 1 byte or there abouts. All other files download ok , just PDFs seem not to. here is my code, the $filecontrol->insertFileDownload() are just database logs being inserted <?php ob_start(); session_start(); include("../classes/files.php"); $filecontrol = new FileControl(); $var_fileid = $_GET['fileid']; $userid = (isset($_SESSION['userid'])) ? $_SESSION['userid'] : 0; if ($userid == 0) die('you are not logged in'); if ($filecontrol->isFilePublic($var_fileid)) { $file = "../filedump/" . $filecontrol->getFileName($var_fileid); $filecontrol->insertFileDownload($var_fileid,$userid,true); } else { if ($filecontrol->doesUserHaveRights($var_fileid)) { $file = "../filedump/" . $filecontrol->getFileName($var_fileid); $filecontrol->insertFileDownload($var_fileid,$userid,true); } else { $file = "../filedump/" . "norights.txt"; $filecontrol->insertFileDownload($var_fileid,$userid,false); } } $file_extension = strtolower(substr(strrchr($file,"."),1)); 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: $ctype="application/force-download"; } header("Pragma: public"); // required header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private",false); // required for certain browsers header("Content-Type: $ctype"); header("Content-Disposition: attachment; filename=\"".basename($file)."\";" ); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".filesize($file)); readfile("$file"); exit(); thanks for reading
-
so is this resolved? ? if not can you show the current code state?
-
if you get an undefined index error when echoing, its session_start()
-
THANKYOU PHPFREAKS! Received 1st Place in Canada!!!!
spiderwell replied to phpSensei's topic in Miscellaneous
Only just saw this, well done sir! lets see you take on the world and win too! -
so you do need jquery then? google jquery accordian
-
what file extension is your file also.
-
the sun website, new times website, new international and probably some others all been hacked by these guys. for once i actually think they are hacking the right people, not that i really condone it, but it is making me smile.
-
for wysiwyg editing the CKeditor is a great thing to attach to a textarea. that what i used in my home grown cms
-
the img.php, I would assume it takes the ID and cross refernces to a database to fetch the image either as a BLOB or just filename, and then outputs the image directly. not sure why you would want to md5() it?, maybe i mis understood that part. you could md5 values in php and have them in the querystring, not sure why you would bother personally, unless I missed something? echo "<a href='$website/click.php?id=$id&user=" . md5($user) . "'>";
-
I am having a go at making a site with a lot of jquery ajax stuff. I have an image with a class of manageusers, and when clicked it loads up the users listings. I think want to turn the paging links to do the same thing but also pass which page, however it wont pass them as a link it just does a normal GET method to the page. So i tried an laternative method of turning the link into a span with the same classname, and adding cusotm attributes to pass the info instead and that doesnt seem to work either!! any help would be apprciated, I know there is a simple way to do it, but I cant seem to find one online. in my code I have only 1 record per page just for testing $('.manageusers').click(function(e) { $("#loading").show(); var thiscache = $(this); page = thiscache.attr("page"); direction = thiscache.attr("direction"); order = thiscache.attr("order"); var dataString = "page="+ page + "&order=" + order + "&direction=" +direction; alert(dataString); $.ajax({ type: "GET", url: "a/a_manageusers.php?", cache: false, success: function(html) { data: dataString, $('#admincontainer').html(html); }, error: function() { $("#admincontainer").show(); $('#admincontainer').html('<span class="red">There was an error fetching the users</span>'); } }); $("#loading").fadeOut(800); e.preventDefault(); then the html in the page looks like this: <div id="admincontrol"> <img src="../images/users_two_48.png" class="manageusers" border="0" width="30"> </div> <div id="admincontainer"> <ul style="margin: 0px; padding: 0px;"> <li style="background-color: rgb(238, 238, 255);" id="userorder_28" class="listtext" onmouseover="style.backgroundColor='#ffffff';" onmouseout="style.backgroundColor='#eeeeff';"> <div class="userfullname"> Johnny Alpha</div><div class="usergallery"> <span style="font-style: italic;"></span> </div><div class="username"> Johnny</div> </li> <li id="paging" class="listtext"> <span style="font-style: italic; float: right;">Page 1 of 3 </span> 1 <span class="manageusers" order="ID" direction="DESC" page="2">2</span> <span class="manageusers" order="ID" direction="DESC" page="3">3</span> </li> </ul> </div>