Jump to content

Jagarm

Members
  • Posts

    42
  • Joined

  • Last visited

About Jagarm

  • Birthday 01/02/1981

Contact Methods

  • Website URL
    http://www.berwari.net

Profile Information

  • Gender
    Male
  • Location
    Ontario, Canada

Jagarm's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for the solution that is easier than what I was doing.
  2. if you do $var = $_GET then you'll have an array, but $_GET['toppings'] is not an array. If you are trying to get the checkboxes, first make sure your form is set to method = "post" and now when you do $_POST['topping'] you will get an array
  3. refer to this page http://ca3.php.net/header if you need more info
  4. instead of echo('<b>Correct!</b>'); you could just redirect to another page header("localtion:pagename");
  5. Try the following: <[^>]*>([^\r]*?)</.*> the result that you get from there may contain additional spaces which you must trim it.
  6. Maybe this function will help you http://ca.php.net/manual/en/function.sort.php , it sort arrays
  7. Hello everyone, I am trying to extract some stuff from a page, the following is what i have so far. $content = file_get_contents ( "http://www.dfo-mpo.gc.ca/media/news-presse-eng.htm" ); echo preg_match_all("/<li>(<[^\r]*?)<\/li>/", $content, $maches,PREG_SET_ORDER); echo "<pre>"; print_r ( $maches ); echo "</pre>"; If you view the source on that page you will see I am trying to extract whatever is in <li> and </li> and contains a hyperlink inside <li> and </li> I'm been trying so hard with no luck. I have the regex testbed that I test the regex, it works there but not with php. I would appreciate for your help. Thanks
  8. Nevermind, I got it! No matter what subdomain the file is, this will make it like it is stored on the same domain. Pretty useful $dir="/path/to/dir/"; if (isset($_REQUEST["file"])) { $file=$dir.$_REQUEST["file"]; header("Content-type: application/force-download"); header("Content-Transfer-Encoding: Binary"); header("Content-length: ".filesize($file)); header("Content-disposition: attachment; filename=\"".basename($file)."\""); readfile("$file"); } else { echo "No file selected"; }
  9. Greetings all, I have a subdomain http://clips.berwari.net and it contains clips, now I don't want the user to directly download the clips from there, but from beta.berwari.net, which will be the main site once completed. At the moment I have it so when the user tries to download something directly from http://clips.berwari.net it goes to http://beta.berwari.net/movies. This is working fine and that is how I want it. Is it possible to set a variable or something, and let the script tell it that if the user request the link from http://beta.berwari.net let the downloading begin, but not otherwise. Please let me know if you got confused. Thanks
  10. Try the following and let me know if it works for you: RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} \.(gif|jpg|jpeg|png)$ RewriteRule .* /notfound.jpg [L] It works fine for me.
  11. Now I get it, really appreciate for the explanation
  12. I apologize for the confusion. The following is my .htaccess Options +FollowSymlinks RewriteEngine on RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule ^([^/\.]+)/?$ /index.php?display=$1 [L] RewriteRule ^([^/\.]+)/([^/\.]+)/?$ /index.php?display=$1&action=$2 [L] Now let's say I have this link now if you mouse over you will see is in the ugly format, and that is what it will display in the address bar. My question here is, is there any way or flag that can display http://beta.berwari.net/contact instead of http://beta.berwari.net/index.php?display=contact? I am able to convert from http://beta.berwari.net/contact to http://beta.berwari.net/index.php?display=contact but that is not what i want is the other way around. I don't want the user to see http://beta.berwari.net/index.php?display=contact in the address bar, even if a link is in that format I want to convert it into the proper format that is www.domain.com/page_ :police:name Sorry the site is restricted to certain sites only due to work in progress. I hope I have made it clear and if not please let me know. Thanks for your help
  13. Actually I'm correct, see some of my links are in this format http://beta.berwari.net/index.php?display=contact and when links like those are clicked, I want in the address bar to be http://beta.berwari.net/contact
  14. I was wondering if it's possible to redirect if user enters http://beta.berwari.net/index.php?display=contact to http://beta.berwari.net/contact Thanks
  15. This is what I was looking for and thanks to http://www.workingwith.me.uk/blog/software/open_source/apache/mod_rewriting_an_entire_site I found the way, this is how I done it, in case somebody like me is trying to search for something simlar Options +FollowSymlinks RewriteEngine on RewriteRule ^([^/\.]+)/?$ /index.php?display=$1 [L] RewriteRule ^([^/\.]+)/([^/\.]+)/?$ /index.php?display=$1&n=$2 [L] Thanks to those who looked at my post
×
×
  • 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.