Jump to content

jaikar

Members
  • Posts

    136
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jaikar's Achievements

Member

Member (2/5)

0

Reputation

  1. you may have to use javascript to make it easy <form action="somepage.html" name="form1"> <select onchange="changeAction(this)"> <option>test 1</option> <option>test2</option> </select> </form> <Script> function changeAction(obj) { if(obj.value == 'test1') { document.form1.action = "http://www.test1.com"; } else if(obj.value == 'test2") { document.form1.action = "http://www.test2.com"; } } </script> Second option is .. doing an auto submit, but even for that you will have to use javascript, compared to that, the above option is easy i guess or you may have to use CURL, but not sure if you want to go to that level.
  2. great man!.. i love the chunks idea! .. i think that will really help... really thanks for your time!.. also, does explode function actually loops in the background or it does it in a different way ? which is better, looping through the words manually or just use the explode option? OR both are same?
  3. hi there, i have a project to submit in college, its like user uploads a sentence of letters in a text file, it can be 5000 words to one million, now the code need to process it and display how many unique words, how many times the word have repeated itself, and couple of more data.. i am confused which way i should do this, should i use an explode on so many words? or loop through each words and store them in an array, but the array may get too bulky? will it slow down the server? or terminate script etc?.. please show some light on this.. thankyou very much in advance!
  4. hi there, is there a difference between if($var == false) and if(false == $var) thankyou!
  5. rwwd, thankyou so much for your time and inputs!.. highly appreciate it.. i would like to add you to my buddy list, also would like to discuss on some best php practices, are you interested?
  6. oh ok!.. thankyou!.. is "Array" is a class in php or data type ? and is array different from Array?
  7. hey!, it works now if i substitute the arg type to stdClass instead of object like function getEmail(stdClass $result) ok, so i should not declare the type, but have to use the class name instead of the type name ... but i still have to use type name in case of array?.. quite confusing here... have to test more ... please let me know if you know more on this .. thankyou!
  8. thanks for the reply! well, error_reporting is default, i did not changed it. also it say its a fatal_error, which seems an important error? i did not passed any var as the second parameter, but i just tested by passing "stdClass" as a second param, but it still returns an error, if possible can you test on your machine and change the query according your database if its handy and let me know what happens, so i can know if any other problem on my server side?.. thankyou!
  9. hi there, i am fairly new to OOPs in php, i get an error when i declare the argument type (as object) in a function and pass the same type (object). class eBlast { public static function getEmail(object $result) { return $result->email; } } $r = mysql_fetch_object($query); eBlast::getEmail($r); echo gettype($r); // outputs: object error is : Catchable fatal error: Argument 1 passed to eBlast::getEmail() must be an instance of object, instance of stdClass given, called in C:\wamp\www\integra\client\pl_eblast\admin\send_emails.php on line 145 and defined in C:\wamp\www\integra\client\pl_eblast\app\app.eBlast.php on line 8 if i remove the type declaration in the function it works, but just would like to know why it shows error when pass the same type, also isnt mysql_fetch_object is the instance of stdclass? thanks in advance!
  10. hi there, this is a general question where i am confused over long time.. what is the used of passing big encrypted strings in the url? most of the time i see in big sites like google / yahoo. and what are the uses of this in real time .. or they are just made big to confuse hackers?. any explanation would be highly helpful!. example as below http://yahoo.com/_ylt=AsXHbMLeE2zV.1Tq082xTdiuitIF/SIG=11licq9d2/EXP=1283427670/**http%3A//mail.yahoo.com/%3F.intl=en http://click.email.microsoftemail.com?qs=06f2de8ca524e4650483090ed07957e8da3dbc0db662e7f97fa1b5d384b45a28800d5407dd3daa63
  11. Hello there, i am using smarty for my project, and i have a registration form that uses smarty, the entire form is generated from a php framework. initially there will not be errors, if there is error in input on submit, it will display the errors to the user.. My question is, will smarty compile the file and create php files on submission each time ? what will happen if the file is accessed by many users and they submit ? to be more clear i was thinking, smarty will compile the tpl files and make it to .php and store in templates_c, so when anyone request the page, it will just display from templates_c... but since the page content changes on submitting will it compile the page again? and what if many users use the page, smarty will go one compile it??.. i am too confused ... help is highly appreciated !! thankyou !!
  12. Dan, YOU ARE THE MANNNNNNNNNNNN !!.. i almost thought there is no function for this task... just tested and works perfect !!! ... i am speechless now ... never thought array_intersect is used for this.. it just says "Computes the intersection of arrays". i was not able to understand that. i am really surpriced for your knowledge in php !! ... thankyou so much
  13. Crayon, ... Awesome !.. and a fantastic explanation .. .. respect !!.... thankyou very much !!. additinally, you also explained the value by referance concept, which would be next question for i did not know why & was used !... actualy, i studied this long back but forgot and never used this in anycodes. . thankyou !.. Dan, !.. happy to see you again !! ... thankyou for the doc link .. it really expains a lot, i did not got this link in google, but after seing the link, i noticed how to pull up help for arguments and callbacks.. php doc is awesome as always!! i have one more clarification, i have a situation where i have to compare values of 2 arrays.. like $arr1 = array('one', 'two'); $arr2 = array('one', 'three', 'four'); comparing like, if $arr2 have atlest one value in arr1, then some code will execute. question is .. is it possble to do this without using a loop ? is there a funciton for this in php ? thankyou !
  14. Awesome Crayon !.. it worked like charm for my purpose... ignace, your idea did not worked.. i dont know why. it said invalid argument. but still, to my question... there is no way to use a method as argument in array_walk ? thankyou!
  15. hi there, i am trying to use a method in array_walk.. something like this class test { function one() { $t = array('one', 'two'); array_walk($t, '$this0>converttolower'); } function convertolower($value, $key) { $t[$key] = strtolower($value); } } the above is not working, how to make something like this work. thankyou.
×
×
  • 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.