Jump to content

mojito

Members
  • Posts

    74
  • Joined

  • Last visited

    Never

Everything posted by mojito

  1. If I get a url like [a href=\"http://localhost/cambs.eu/listing/properties.php\" target=\"_blank\"]http://localhost/cambs.eu/listing/properties.php[/a] then the rule RewriteRule listing/(.+) /listing.php?type=$1 should give /listings.php?type=properties.php It doesnt in fact the query string isnt working. What am I doing wrong. Even if i hard code something the query string isnt output. thanks for help on this. mojito
  2. here is some code in my .htaccess im trying to figure out... [code]RewriteBase / RewriteRule ^\.htaccess$ - [F] RewriteRule listing/(.+) /listing.php?type=$1 RewriteRule faq/(.+).php /roatan-faq.php?catid=$1 RewriteRule photo_album/(.+)/(.+) /spg_view_category.php?category_id=$1 RewriteRule photo/(.+)-(.+)/(.+) /spg_view_image.php?image_id=$1&category_id=$2[/code] I cant work out how from my localhost machine where im testing this stuff it actually links to the real website so somehwhere the domain is getting changed from the root which should be localhost but is not. Is it the RewriteBase command ? I cant work out I just figured out that problem there was a <base> tag set in the source. Silly me. But here is my problem, I cant get it to work on my localhost. I cant debug it, i cant see what the rewritter is creating its not right as it cant find the page, how can i do an echo or print in .htaccess? Also how can I comment out lines in .htaccess I tried a # but it doesnt seem to work. [edit it does work now] thanks mojito [img src=\"style_emoticons/[#EMO_DIR#]/excl.gif\" style=\"vertical-align:middle\" emoid=\":excl:\" border=\"0\" alt=\"excl.gif\" /]
  3. [!--quoteo(post=385090:date=Jun 17 2006, 08:52 PM:name=steelmanronald06)--][div class=\'quotetop\']QUOTE(steelmanronald06 @ Jun 17 2006, 08:52 PM) [snapback]385090[/snapback][/div][div class=\'quotemain\'][!--quotec--] Regular Expressions (RegEx). This is simple to understand. The rule works like this. A url that someone types in like so: [a href=\"http://www.site.com/listing/700\" target=\"_blank\"]http://www.site.com/listing/700[/a] will actually point to: [a href=\"http://www.site.com/listing.php?type=$1\" target=\"_blank\"]http://www.site.com/listing.php?type=$1[/a] The best part about it is it is Spider Friendly, easy to remember, and when a user points to the first url they will always see it but the webserver will see the second url. [/quote] Sorry I should have made it clearer, I know the point and theory behind mod rewrite, i just dont understand the rules, are you saying they use regular expressions? I will check on that in any case. The $1 actually gets converted to some value given by the url. This is what is confusing me. Thanks mojito
  4. Dear Freaks like me I have to understand the following [code]RewriteRule listing/(.+) /listing.php?type=$1[/code] this is in the .htaccess file. I think it means if the url has listing/ then replace with /listing.php?type=$1 does the $1 get converted to the value (.+) This is a crazy useful language to me. Thanks mojito
  5. Dear fellow freaks I want simply to backup a database of about 3Mb using phpmyadmin fails, cant work out why, so i turn to putty and command line. using every single thing i can think of i keep getting "there is an error in your syntax at line 1" i have tried everything i can think of. What would be a foolproof string to type in if im logged in and already in mysql-> I realised i need the comma at the end of each line, now why is that not expalined in the documentation (mysql.com) ? are we like just supposed to know mysql?? I tried [code]mysqldump --tab=/usr/home/dfrty/www/htdocs/backup[/code] it cant be any easier so why is it telling me there si syntax error? grrrrr [img src=\"style_emoticons/[#EMO_DIR#]/excl.gif\" style=\"vertical-align:middle\" emoid=\":excl:\" border=\"0\" alt=\"excl.gif\" /] I just found out there is BLOB data and this is why its so large. Im tempted to try to find the actual file in the db and just copy that.
  6. THANK YOU SO MUCH TO BOTH OF YOU. Im sure I can get it now, too busy to get on this problem right now, but im sure I can understand the results from this now. If only the original coder had commented as such or explained a little. Commenting code is good, at least for me. thanks again m [img src=\"style_emoticons/[#EMO_DIR#]/laugh.gif\" style=\"vertical-align:middle\" emoid=\":laugh:\" border=\"0\" alt=\"laugh.gif\" /]
  7. [code]mysql_query("select a.aid as AlbumID, a.Title as Title, a.pid as PictureID, p.thumbname as Picture, count(l.pid) as Cnt from albums a, pictures p, pictures l where a.aid = p.aid and a.pid = p.pid and a.aid = l.aid group by a.aid order by a.aid", $connection); [/code] the bit i dont get is the following bit... [code]count(l.pid) as Cnt from albums a, pictures p, pictures l where a.aid = p.aid and a.pid = p.pid and a.aid = l.aid group by a.aid order by a.aid[/code] thanks for any help
  8. [!--quoteo(post=376377:date=May 23 2006, 04:01 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ May 23 2006, 04:01 PM) [snapback]376377[/snapback][/div][div class=\'quotemain\'][!--quotec--] The output occured around line 22 in [b]header.php[/b] and the error was triggered in [b]main.php[/b] on line 4. If you could post lines 15 - 25 from header.php here and lines 1 - 6 from main.php here too we'll be able to help you alot more. You are getting that error message becuase there is output before the use of the session_start() was called. You cannot output any html/text/whitespace before the use of session_start. [/quote] 4, /*session_start('PHPSESSID'); 5, session_register("session");*/ removed then removes the error. but they are needed in this script for authentication. The problem is someone has included this file here as a hack to get the db working and vars available etc but there is a lot of html which comes before this include, so yes i see why it is broken. What I WANTED TO KNOW WAS (sorry) what happens to the sessions if the browser is closed etc, i thought they are killed automatic but they exist on the server right? so how can i be sure to get rid of all session info and if register globals is on. thanks.
  9. thanks to both of you, i didnt know url encoding didnt happen automatic. If I understand corectly- it encodes the "&" symbol to url friendly format.
  10. can someone explain what this does ini_set("arg_separator.output", "&amp;"); thanks
  11. I have reviewed the post concerning sessions and headers yet it didnt answer my question so I ask here. appologies. i get the following error Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /usr/??/???/httpd/?????/paradise.com/htdocs/header.php:22) in /usr/l.../paradise.com/htdocs/design/include/main.php on line 4 I needed to write a backend admin and used session to store an md5 encoded user password. on logout i need to kill and remove this session. Since i used session_start(); in that code and it wasnt at the very top of a particular page including all includes it gets that error..as there is other code i am not aware of using session. The page which gets the error is not using my code though so is it becuase a session gets set on the server which means it causes the error? Is there a good tutorial explaining session variables for php and conflicting uses. thanks mojito
  12. Thanks ober, thats really useful, but I can see that "a" is later said to be album and "p" is said to be pictures but the bit I also dont get is the "l" or "1" here.. [code]pictures l where a.aid = p.aid and a.pid = p.pid and a.aid = l.aid group by a.aid[/code] thanks for sharing your knowledge with us. [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]
  13. I would like to understand the syntax used here as i want to access after the field in the table called thumbname [code]select a.aid as AlbumID, a.Title as Title, a.pid as PictureID, p.thumbname as Picture, count(l.pid) as Cnt from albums a, pictures p, pictures l where a.aid = p.aid and a.pid = p.pid and a.aid = l.aid group by a.aid order by a.aid[/code] what is the "as" bit doing? im trying to loop through thus... while($album = mysql_fetch_array($mysql)) { echo $album[thumbname]; thanks [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /]
  14. [!--quoteo(post=374714:date=May 17 2006, 04:31 PM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ May 17 2006, 04:31 PM) [snapback]374714[/snapback][/div][div class=\'quotemain\'][!--quotec--] Please post the souce for your form. You need to make the name of the select list an array. [code]<select name="select[]" multiple>[/code] Ken [/quote] yer i tried that and the result is select%5B%5D=me&select%5B%5D=too&Submit=Submit so its just encoding the brackets, and not making an array. here is my source [code]<select name="select[]" size="2" multiple="multiple">     <option value="me">1</option>     <option value="too">2</option>   </select>[/code] m
  15. Hi freaks Im comming back into some form problems, i thought a multiple select form sent a comma separated values but when using and selecting multiple options the query string is like select=me&select=too&Submit=Submit do i have to iterate through each select and make an array myself? thanks mojito
  16. Its easy to dump a database using phpmyadmin, however I would like to know how to dump this file to a new database name. I tried modifying the sql at the top where it creates the database. This gave an error. I have putty and would like to know how i can use it locally to do this stuff from a command line. Any help with any of the above is greatly appreciated. m
  17. I am looking to see if I can compare two arrays. Im looking to get a true or false back from looking to see if ALL the values in array 1 are in array 2. The php site in terms of arrays isnt so clear on this. thanks mojito
  18. [!--quoteo(post=361250:date=Apr 3 2006, 04:04 PM:name=jworisek)--][div class=\'quotetop\']QUOTE(jworisek @ Apr 3 2006, 04:04 PM) [snapback]361250[/snapback][/div][div class=\'quotemain\'][!--quotec--] Thats just a small portion of the option I use, I was too lazy to stick them all on here ;) [/quote] not at all thanks for that help, it will be something really like that. It was the sql AND....AND...AND all the time reducing the recordset that was real handy. Do you think its good practise to make a temporary table for the initial recordset and then run the sql on that after making it indexable.. I guess I'm just after a best practise method for this stuff. but thanks again m
  19. I dont have much built yet, it is in php. I need to know if it is possible first and the best methodology. I believe its more an mysql question than anything else, i dont need to know how the php will work so much, i want to know what i can do in one foul swoop with mysql. thanks
  20. Hi guys Im a bit new to sql but have some basics enough to get me here! I have a recordset and Its to do with listings, which i want the user to be able to sort by maybe 5 maybe more (and why not more) criteria which get presented at the top of the list in a dropdown box. The user then clicks submit and i need a mega sql statement to sort on multiple field criteria. If someone could tell me if this is possible would be a great help, otherwise I would have to do a big recordset and then filter one at a time having a new sql statement each time. I have seen that it might be possible to loop around for each criteria and append to the main query string each loop creating a long statement. I like the idea of it being extensible too. thanks mojito
  21. Using the code in a htaccess file one can specify that any file extension be treated as if it were a php file. I wonder why this is done, for me it makes a dependancy situation arise that if the htaccess is not there then the code is output to the browser and a security risk. Ok so we can be careful but is it a SEO thing? do .php pages get a worse treatment from spiders? what other considerations.. here is the content of the .htaccess for complettness-would this replicate in child folders or does this file need to be in child folders too? [code]AddType application/x-httpd-php .html AddType application/x-httpd-php .htm AddType application/x-httpd-php .php3[/code]
  22. All I need is to check a string separated by commas for particular values, rather than have to get each field split it and test it for the value. a string could be (in the db) "sandy_bay,2,4,55" for example and i might want to test for 2. and get a positive result in this case. thanks guys.
  23. I cant seem to see where is the syntax error in the following [code]"SELECT crit_string,ID FROM clients MATCH(crit_string) AGAINST ('ee')"[/code] please anyone? i dont have to specify the db as thats in the connection and i specify the table as clients, im looking to search in the field crit_string for 'ee' i have set the full text for that field also. thanks
  24. After basic javascript (clientside) verification what steps should I take with my data fields. I would like some of the fields to be able to contain some basic formatting in HTML like </strong> etc... This poses me a question as I cant just remove these characters. This html is (normally) comming from my WYSIWYG editor attached to my text field. Is there a good resource that deals with this or better a brief list of key checks that should be made server side just before the INSERT. Thanks for any insight you freaks. PS If your in the cambridge area come and join a cool discussion forum at [a href=\"http://mycambs.com\" target=\"_blank\"]www.mycambs.com[/a]. Why is it cool? because it has some very interesting topics of discussion and members who challenge thought. It isnt into globalisation either we do welcome tree huggers and also corporate monkeys alike!
×
×
  • 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.