Jump to content
Old threads will finally start getting archived ×

krike

Members
  • Posts

    35
  • Joined

  • Last visited

    Never

Everything posted by krike

  1. I have a few questions about rewriting url I have the following which works Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^tutorial/(.*+)$ view_tutorial.php?tutorial_id=$1 [L] RewriteRule ^home(.*+)$ /index.php [L,QSA] as you can see I redirect index.php to /home, but there are other pages I would like to do this (like advertise.php) I copy pasted the code and added this at the end of the file: RewriteRule ^advertise(.*+)$ /advertise.php [L,QSA] Question 1 but for that part I'm getting a 500 internal server error but not for index.php, can I just add another rewrite under the index.php? Question 2 ^tutorial/(.*+)$ view_tutorial.php?tutorial_id=$1 shows /tutorial/21 but I would like to display the tutorial name instead of the id, any idea how I would do this? or is there something else I should do? any help would be appreciated (noob here )
  2. my system is installed on a submap called /cmstut should I upload a .htaccess file in that map and add that code there? or on the root site? and should I add the following code? (is it correct): RewriteEngine On RewriteCond %{THE_REQUEST} ^GET\ /.*\;.*\ HTTP/ RewriteCond %{QUERY_STRING} !^$ RewriteRule .* http://www.iv-designs.org/cmstut%{REQUEST_URI}? [R=301,L]
  3. I've tried different things based on this article http://www.blogstorm.co.uk/htaccess-mod_rewrite-ultimate-guide/ but nothing seems to work, but when i upload messy code I do have 500 internal server error (did that on purpose to see if it would do anything) I checked my host and found a small tutorial about rewrite, so it should work on my host... ps: I'm now working in a submap, could that affect anything?
  4. thanks I'll try that out tonight
  5. I have fixed most of them, if you could check them out again one thing I can't fix cause I have no idea how is the following: http://iv-designs.org/cmstut/search.php?search[] I get: any help would be appreciated
  6. aha sounds like a lot of work ahead... lucky I posted here one thing please, could you remove the path to the website out or your post please? just to be save. I'm going to turn off error report on that website. I know people can use it to hack. thanks for your help thanks for the tip
  7. validation text: http://iv-designs.org/cmstut/krike.txt I have created a tutorial system like pixel2life.com and I would like people to test it out. especially the security I'm using mysqli and mysqli_real_escape_string() to protect most of the website. The tutorial system is written in OOP and I used try&catch for the error reports website: http://iv-designs.org/cmstut/ How it works? 1- We'll... just register and login 2- Submit a tutorial (needs to be approved by admin first) 3- click on a link to view the detail page of a tutorial ° You can rate tutorials ° You can comment (needs to be approved by admin) 4- You can edit your profile 5- Add tutorial to your favorites I also implemented a gravatar system, when it's checked it will use the email for the gravatar, if not the image which was uploaded or the default image if nothing was uploaded (you will find that option when editing your profile) so that's pretty much it, the goal of that website is to offer people a site where they only find tutorials for CMS systems like wordpress, vBulletin, joomla,... and so on (but also webdesign, css/xhtml/php tutorials) question I do have one question, I'm only using sessions for know because my web teacher told me not to use cookies (you can modify them, he told me) I then asked how could I create the session so that the browser keeps the user info even after closing the browser and he told me to look for that answer so i'm asking you guys does anyone know if cookie is bad? if not what information should I store in the cookies? or if my teacher is right how would I extend sessions? grz krike ps: general feedback about the layout and other is welcome, escpecially the usability
  8. just like that? cause I get an invalid argument. I checked the phpmanual and found that you need to pass 2 arguments. anyway that's not the problem, in fact it's not for me but for whoever want's to use it. but not everyone will have the same temporary file... so I don't think that will solve my problem unless I'm wrong?
  9. I'm not using the stripslashes(), here is the code: <?php $username = $_POST['sender_name']; $result2 = $db->sql_query("SELECT * FROM `". $prefix ."_upload_config`"); $config = $db->sql_fetchrow($result2); $path= "modules/Upload/images/"; include_once('header.php'); OpenTable(); $random_digit=rand(0000,9999); $filename = $random_digit.$_FILES["file"]["name"]; $filetype = $_FILES["file"]["type"]; $filesize = $_FILES["file"]["size"]; $filetmp = $_FILES["file"]["tmp_name"]; $error = $_FILES["file"]["error"]; $maxsize = $config['maxsize']; $url = $path.$filename; if ((($filetype == "image/gif") || ($filetype == "image/jpeg") || ($filetype == "image/pjpeg") // for IE || ($filetype == "image/png") //to allow another extention just copy paste this line //and place then the copied line here // a dynamic version will be released in v1.2 or v1.3 (so add extention from administration) ) && ($filesize < $maxsize)) { if ($error > 0) { echo "Return Code: ".$error."<br />"; } else { echo "Upload: ".$filename."<br />"; echo "Type: ".$filetype."<br />"; echo "Size: ".$filesize." Kb<br />"; echo "Temp file: ".$filetmp."<br />"; if (file_exists($url)) { echo $filename. " already exists. "; } else { move_uploaded_file($filetmp, $url); echo "Stored in: ".$url; $result = $db->sql_query("SELECT * FROM `". $prefix ."_upload`"); $db->sql_query("INSERT INTO ".$prefix."_upload (username, img) VALUES ('".$username."','".$filename."')",$result) or die(mysql_error()); } } } else { echo "Invalid file<br /> This error can be caused by a wrong file type or if the file is to big."; } echo "<div align=\"center\">[<a href=\"modules.php?name=Upload\">Go back</a>]</div>"; CloseTable(); include_once('footer.php'); ?>
  10. Hey all first of all I'm new so hy my question is regarding the temporary file, I'm running 2 CMS systems on my xampp local server, the first is called PHP-nuke and the second is Nuke evolution (which is build from phpnuke) I created an upload module for both and they work great on real webservers, however on localhost I have the following problem: when uploaded it does not show the proper path (the "\" are missing, but this only happens locally not on real webservers) -> Temp file: C:xampptmpphp42B6.tmp while in regular phpnuke it works fine -> Temp file: C:\xampp\tmp\phpEB72.tmp it uses the same settings so why are the "\" missing? hope anyone can help me out
×
×
  • 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.