Jump to content

scs

Members
  • Posts

    86
  • Joined

  • Last visited

    Never

Everything posted by scs

  1. So I went ahead and tested the code in my second post. Everything works the same but when ever I try to access a link like: http://www.mysite.com/manga/Naruto/001.5/ I still get a 404 any advice to point me in the direction so I can figure this out would be extremely helpful! The trouble it would cause to "simply" rename the folders so I don't have .5 would take weeks..
  2. cant edit my post.. for the part where I want to "change ([0-9]+) to ([^/.]+)" I mean like this: Options +FollowSymlinks RewriteEngine on RewriteBase /manga/ RewriteRule ^mangas/([^/]+)/([^/]+)/$ - [F,L] RewriteRule ^mangas/([^/]+)/$ - [F,L] RewriteRule ^mangas(/?)$ - [F,L] RewriteRule ^([^/.]+)/([^/.]+)/([^/.]+)(/?)$ index.php?manga=$1&chapter=$2&page=$3 [L] <<< note the change on this line from the original RewriteRule ^([^/.]+)/([^/.]+)(/?)$ index.php?manga=$1&chapter=$2 [L] RewriteRule ^([^/.]+)(/?)$ index.php?manga=$1 [L]
  3. So my problem is probably simple I just don't understand htaccess very well. Here's the original working rewrite Options +FollowSymlinks RewriteEngine on RewriteBase /manga/ RewriteRule ^mangas/([^/]+)/([^/]+)/$ - [F,L] RewriteRule ^mangas/([^/]+)/$ - [F,L] RewriteRule ^mangas(/?)$ - [F,L] RewriteRule ^([^/.]+)/([^/.]+)/([0-9]+)(/?)$ index.php?manga=$1&chapter=$2&page=$3 [L] RewriteRule ^([^/.]+)/([^/.]+)(/?)$ index.php?manga=$1&chapter=$2 [L] RewriteRule ^([^/.]+)(/?)$ index.php?manga=$1 [L] Note the "mangas" folder is where the chapters are (Root/manga/mangas/Naruto/) resulting in: http://www.mysite.com/manga/ http://www.mysite.com/manga/Naruto http://www.mysite.com/manga/Naruto/001/ http://www.mysite.com/manga/Naruto/001/2 (page 2) now what I have run into is some chapters have 001.5 http://www.mysite.com/manga/Naruto/001.5/ That gives me a 404 on my server. I want to either change the whole rewrite or add the option for this variant. I already tried this below. and it does not work. Original RewriteRule ^([^/.]+)/([^/.]+)/([0-9]+)(/?)$ index.php?manga=$1&chapter=$2&page=$3 [L] Mine RewriteRule ^([^/.]+)/([^/.]+)/([0-9]+).([0-9])(/?)$ index.php?manga=$1&chapter=$2&page=$3 [L] taking note to this .............................................^^^^ I also tried that with the plus ([0-9]+) and still did not work and I did not replace the original line. I added my line right below. Now for the ([0-9]+) part. I might have some mangas (later on) that might have 001.a. Would it b possible to just change ([0-9]+) to ([^/.]+) then that way I could just skip the whole "adding .5 .a" and just grab all the of chars between the / / or would that cause the whole rewrite to fall apart? I figured I would ask that before I try it. Hope that all made sense. getting tired after working on the site all day >.< would be thankful for any advice on the subject Thanks!
  4. I didn't find any include_path in my php.ini nor did I find anything relating to PEAR =/ You know how the commands should look? I'll just add them manually Also "whereis" command said PEAR (since php-pear pulled up nothing) is located at # whereis pear pear: /usr/bin/pear /etc/pear.conf /usr/local/bin/pear /usr/local/etc/pear.conf /usr/share/pear seems like there is a bunch of messy stuff happening >_<
  5. SOAP sounds the best way to pass it. SOAP uses XML already to pass params between servers. and with SOAP you can use just about any other programming laughing to send/receive it as well.
  6. It found and installed it. but I still get the error. It seems like PHP cant find PEAR or something like that. Not really sure. I did come across some forums that said I need to tell PHP where to find PEAR. Maybe that's my problem? and if so then what would I edit :confused:
  7. So I installed a script that needed PHP5. So I manually upgraded to PHP5. Well there's an error and the creator of the script says I need to reconfigure PHP5 with PEAR. The odd thing is I see PEAR installed. Another problem is I cant find the site that I used to install PHP5 from yum. So I'm looking for a easy set of commands to reconfigure/install PHP5 with lots of extensions and PEAR configured with it. Hope someone can help Thanks for any help
  8. Hi, So I have this idea for making a Binary container with php. Google has not been much help so im just looking for a little insight so I can get started. I dont really want code (or at least alot) cause I want to be able to make this on my own. What I want to know is first is it possible to make a Binary container using just php? To explain what I mean by a Binary container. Think of .MYD files in MySQL or even .DLLs. A File that holds and is constructed of Binary. Not just a file you split using explode() function. If that is possible then my next question is do I just use regular php binary read and write? then just handle the data with binary trees? If I can get those to answered I should be able to research further on my own and make it. Thanks in Advance Z
  9. scs

    seems so simple.

    wow it was even more simple than I thought.. I need some work in regex Super thnx! ;D
  10. I have a expression which finds a hexadecimal thats 32 charaters long. Im just using match all to make sure it finds what im looking for. I want my end result to be just a preg match. preg_match_all('((#?([A-Fa-f0-9]){3}(([A-Fa-f0-9]){3})?).{32})', $content, $output); It finds it out of the 135 lines. Most of the lines are not even hexadecimal.. Well I have a simple solution but cant figure how to do it. Theres another 8 hexadecimal set that I already know. The 8 is infront of the 32. So example [ 8 ][ 32 ] d7d8v94314619d326c74fe875f26d4561c4c662e So my question is how to I add the 8 in front of my expression? I've tried.. preg_match_all('(' . $hex_8 . ')((#?([A-Fa-f0-9]){3}(([A-Fa-f0-9]){3})?).{32})', $content, $output); preg_match_all('(~' . $hex_8 . '~)((#?([A-Fa-f0-9]){3}(([A-Fa-f0-9]){3})?).{32})', $content, $output); I used ~ cause I saw someone use it in another expression. All I get is an error. Like Warning: preg_match_all() [function.preg-match-all]: Unknown modifier '(' Any ideas? Thnx
  11. scs

    Help parsing a URL

    wow It worked! Thanks so much!! Zach
  12. Hi all I'm having some trouble parsing a URL from downloaded site content using fsockopen. I'm making a Voting system for my site and this will be part of it. I am simply just getting a URL. The URL is very unique yet I can't seem to get it. The end of the URL has a session tag so its always changing. There's also a class in the URL tag that's not on any other link. That should definitely help! I thought. lol So here is what I got so far After downloading the site into a variable I'm trying to parse all info I want from it. $regex = '/href="(.*?)" class="buttongo"/'; preg_match($regex, $output_data, $stuff); print_r($stuff); //Nothing comes out The URL looks like this <a href="http://www.mysite.com/index.php?a=in&u=username&sid=rjhgf2hWm9WDFTkgx9JJd290udtkIgfM" class="buttongo">Enter</a> I want the URL as a whole so I was just trying to match the unique class. And I know the data is correct because I got the URL from echo 'ing the data im parsing. Also as you can see in my code I didn't include any of the tag. Like, <a> cause im not sure what I need to escape and if thats part of my problem. I've never been able to find html tags very well. So any tips on that would be great as well! I hope thats enough info to understand what I am doing. Thanks Zach
  13. I was expecting code but I think that lil change of words I think did it o_o lol thnx I'll try that
  14. Hi I am trying to make a PHP Proxy usage. Not for being a proxy, but for using the proxies for different IPs. Its for a ranking system on my site. Basicly I'm trying to make a script that uses free proxies like (www.w0t.us) and submits a script from my site. And so in the long run it would run throw a list of free proxies and submit my script so that it runs properly. Though I havent even made my script yet cause this is the first step in my project. I think the curl class is needed for this. So the steps for this script would be (Array) List of free proxies (Loop) Loop through list Submit my script to proxy Read output data Sounds and looks simple. My lil brain just cant figure it out Anyone know hows to do this? Thanks in advance Z
  15. Nope, sry that didnt help. All 3 of those links have static widths for the 2 outer cells. One of them was the exact opposite of what I want Thnx for trying though!
  16. Hi, Im having trouble with my layout. I hope someone can help! Im trying to recreate my layout from a table. Its a 3 cell layout. The focus is the main center cell. The 2 outer cells are just to hold background images to spice up the layout. Some like this: The thing about it that makes it complex is the center cell width is 900px and the two out cells are suppose to fill up the space thats left over. So the center cell with all the content stays in the center of the page and stays the same width. The 2 out cells expand to fill the empty space for every resolution. So a static width will not work unless the rest of the cell is hidden and doesnt obstruct the main content. Here is what I got so far which such bad cause its all messed up. .main { width: 900px; background-color: #666666; margin-right: auto; margin-left: auto; height: 100%; position: absolute; top: 0px; left: auto; right: auto; } .leftb { overflow: hidden; height: 100%; float: left; display: block; background-image: url(/images/theme/black/background_03.gif); background-repeat: no-repeat; background-position: top; position: absolute; left: 0px; top: 0px; width: auto; } .rightb { background-image: url(/images/theme/black/background_04.gif); background-repeat: no-repeat; background-position: left top; overflow: hidden; height: 100%; width: auto; position: absolute; top: 0px; right: 0px; } <div class="leftb"> </div> <div class="main">Main content</div> <div class="rightb"> </div> Does anyone know what im doing wrong? Im still new to tableless CSS Hope someone knows more than me! thnx Zach
  17. In this example it uses opensocket. If you change that to header, It might work. The example here is different than what you were trying to use. "POST $this->uri HTTP/1.1\r\n". "Host: $this->url\r\n". "User-Agent: HTTPPost\r\n". //<<< main difference I pick out "Content-Type: application/x-www-form-urlencoded\r\n". ($this->authInfo ? "Authorization: Basic $auth\r\n" : '') . "Content-Length: $contentLength\r\n\r\n". "$requestBody\r\n"; You could try that, let me know if that helps at all
  18. I found it It was here http://www.phpclasses.org/browse.html/package/375 You have to register to download the files. I did and tested it. It works. heres the files so you dont have to register class.HTTPPost.inc: <?php /* - HTTPPost ver 1.0.0 Author: Daniel Kushner Email: daniel@websapp.com Release: 2 Nov 2001 Copyright 2001 www.websapp.com/classes - - Wilfried Wolf (wilfried.wolf@sandstein.de) modified two things on 04/18/02: 1. dataArray can be any Array now, eg. $dataArray = array( 'firstInput' => '1', 'secondInput' => array( 'field1' => 'a', 'field2' => 'b' ) ); 2. the post() method will now return the responseBody of the request, i.e. no hexadecimal numbers will show up when you try to output the response. the headers of the response as well as the body can now be accessed by new methods getResponseHeaders() and getResponseBody(). if the post() method does not return anything, the error can be accessed by the new method getResponseError - Added basic authentication method by elias@hostrix.com on 12/12/01, 04:54:01PM. new usage: HTTPPost($url, $dataArray, array('username', 'password')) - - Posts an array of data to a given URL using rfc2616 - Hypertext Transfer Protocol -- HTTP/1.1 The data array should be in the form of comma-separated key => value pairs. Both the data and URL can be passed in the constructor or added by using the functions setDataArray() and setURL. - */ class HTTPPost { var $url; var $uri; var $dataArray = array(); var $responseBody = ''; var $responseHeaders = ''; var $errors = ''; function HTTPPost($url = '', $dataArray = '', $authInfo = false) { $this->setURL($url); $this->setDataArray($dataArray); $this->authInfo = $authInfo; } function setUrl($url) { if($url != '') { $url = ereg_replace("^http://", "", $url); $this->url = substr($url, 0, strpos($url, "/")); $this->uri = strstr($url, "/"); return true; } else { return false; } } function setDataArray($dataArray) { if(is_array($dataArray)) { $this->dataArray = $dataArray; return true; } else { return false; } } // can be called as: setAuthInfo(array('user', 'pass')) or setAuthInfo('user', 'pass') function setAuthInfo($user, $pass = false) { if (is_array($user)) $this->authInfo = $user; else $this->authInfo = array($user, $pass); } function getResponseHeaders(){ return $this->responseHeaders; } function getResponseBody(){ return $this->responseBody; } function getErrors(){ return $this->errors; } function prepareRequestBody(&$array,$index=''){ foreach($array as $key => $val) { if(is_array($val)){ if($index){ $body[] = $this->prepareRequestBody($val,$index.'['.$key.']'); } else { $body[] = $this->prepareRequestBody($val,$key); } } else { if($index){ $body[] = $index.'['.$key.']='.urlencode($val); } else { $body[] = $key.'='.urlencode($val); } } } return implode('&',$body); } function post() { $this->responseHeaders = ''; $this->responseBody = ''; $requestBody = $this->prepareRequestBody($this->dataArray); if ($this->authInfo) $auth = base64_encode("{$this->authInfo[0]}:{$this->authInfo[1]}"); $contentLength = strlen($requestBody); $request = "POST $this->uri HTTP/1.1\r\n". "Host: $this->url\r\n". "User-Agent: HTTPPost\r\n". "Content-Type: application/x-www-form-urlencoded\r\n". ($this->authInfo ? "Authorization: Basic $auth\r\n" : '') . "Content-Length: $contentLength\r\n\r\n". "$requestBody\r\n"; $socket = fsockopen($this->url, 80, &$errno, &$errstr); if(!$socket) { $this->error['errno'] = $errno; $this->error['errstr'] = $errstr; return $this->getResponseBody(); } fputs($socket, $request); $isHeader = true; $blockSize = 0; while (!feof($socket)) { if($isHeader){ $line = fgets($socket, 1024); $this->responseHeaders .= $line; if('' == trim($line)){ $isHeader = false; } } else { if(!$blockSize){ $line = fgets($socket, 1024); if($blockSizeHex = trim($line)){ $blockSize = hexdec($blockSizeHex); } } else { $this->responseBody .= fread($socket,$blockSize); $blockSize = 0; } } } fclose($socket); return $this->getResponseBody(); } } ?> example.php: <?php include('./class.HTTPPost.inc'); $arr['name'] = 'Daniel'; $arr['address'] = 'New York'; $arr['email'] = 'daniel@websapp.com'; $arr['foo']['bar'] = 'whatsoever'; $arr['foo']['bar']['query'] = 'something else'; $post = new HTTPPost('http://localhost/postCollector.php', $arr); $result = $post->post(); if($headers){ print nl2br($post->getResponseHeaders()); } print $result; /* equivalent to: print $post->getResponseBody(); */ ?> postCollector.php: <?php if(is_array($HTTP_POST_VARS) && count($HTTP_POST_VARS) > 0) { echo "And here are the results of your post:<br>"; print_r($HTTP_POST_VARS); } else { echo 'Oops, nothing in $HTTP_POST_VARS?<br>'; } ?>
  19. Im a lil new to headers. Never really used them alot. But I believe that may be the problem in the code. I've done similar code for sending an email with an attachment. I'll see if I can get it to work. If anyone who is good with heads knows what the problem is that would be great Zach
  20. Awesome! thats just what im looking for I'll try it out and see if I can help you to
  21. Im modding my PHPBB registration. Im going to have the form submit to a script I made. Then finish by sending back to the original phpbb page. I dont know if u can, but I think its possible with php to submit a form from php. So instead of making a html form and making submit itself I would have php do it itself as one smooth motion. All behind the scenes. Like using curl or something like that. Does anyone know how to do this? Thanks Zach
  22. scs

    Loading bar

    awesome Thanks guys
  23. scs

    Loading bar

    Well its not really what im looking for. Cause with that it would just load the page with meta tag. When someone, say submits a page for one of my script that use soap which can take awhile. The meta tag will only make it longer. I need just like a img in the middle of the page while the rest of the page is loading. See what im getting at? Zach
  24. I've been making bigger and bigger scripts. And some will take a while to load. I've been wondering if I can have a loading bar while my script is loading in the background. So it doesnt look like my site is slow. Kinda like the new beta hotmail and yahoo. I thought of a simple idea. But dont think it will work. Just send the output of the loading bar and then access the script. Then finish the output. Just in one php page. I well come all input on this. But I really want to get this working soon Thanks in advance Zach
  25. Sort to speak. I've seen sites have just a plain iframe with a id. And there is communication happening behind the scenes. If u dont kno what Im talking about I can elaborate on it later. I have a relative idea of what to do. I get the iframe by is id and give it a request. But I want to be able to do that and get the information in the iframe and determine the next operation. Does anyone kno how/what im talking about? Thanx Zach
×
×
  • 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.