Jump to content

hisoka

Members
  • Posts

    569
  • Joined

  • Last visited

Everything posted by hisoka

  1. I took the code from this page : http://www.madirish.net/402 and the $string is wrapped in quotation marks . Why is $string wrapped in quotation marks ?
  2. After some researches , I find that the parentheses are used to group the . and * together , I find , too, that .* does the same thing as (.*) . So I deleted the parentheses and run the code again like this : <?php $string = "this is my lower sting"; print preg_replace('/.*/e', 'strtoupper("\\1")', '$string'); ?> but nothing happened . If (.*) does the same thing as .* so why I got a blank page and nothing happened ?
  3. Thank you for the link I will reformulate my question : why is "/".$string."/" in four double quotes and not between two double quotes like this : "/.$string./" ?? Could you please explain to me why the $string in '/.$string./' is between two dots ? in other words what is the role of the two dots ?
  4. Sorry but I still do not understand why in this code : <?php $string ='<?php phpinfo(); ?>' ; eval('?>'.$string.'<?php'); ?> the php closing tag comes before the php opening tag ?? could you please explain further ?
  5. hisoka

    php curl

    cURL is used to send data to a server website ; It can be used to submit a form to a server website . So why you think that cURL could not send data to a server website in a specific period of time ?? CURLOPT_TIMEOUT_MS and CURLOPT_TIMEOUT cannot set the period of time that a form is submitted or returned to server ??
  6. Hello FoxyMod I hope you got a good weekend I still do not know what the regex (.*) does ? I looked for it here for example http://www.regular-expressions.info/refcapture.html in all the site but I could not find what does (.*) do ?
  7. In this little code : <?php if (isset($_GET['animal'])) { $string =$_GET['animal']; $replacement = 'cat'; if (strpos($string, 'mouse') !==false) { echo preg_replace('/.$string./' , $replacement, 'mouse'); } } ?> the result is mouse Now when I replace '/.$string./' with "/".$string."/" I got cat as a result . I do not know what is the difference between "/".$string."/" and '/.$string./' and what are both dots in '/.$string./' and "/".$string."/" used for ?
  8. In this code : <?php $string = "this is my lower sting"; print preg_replace('/(.*)/e', 'strtoupper("\\1")', '$string'); ?> I do not understand what does \\1 do inside strtoupper I read here : that takes a string as a parameter not \\1 ?? Second question : What does regex (.*) do ? I know that .* means any character, any number of repetitions but not (.*) ??
  9. 1)why in eval() <?php $string ='<?php phpinfo(); ?>' ; eval('?>'.$string.'<?php'); ?> the '?>' comes before '<?php' ?? because normally we put <?php first then end our code with ?> 2)can't we evaluate the above code like this : <?php $string ='<?php phpinfo(); ?>' ; eval($string); ?> ?? 3) is it possible to echo the result of a php code assigned to a variable? for example like this (the example is wrong but put only for the sake of clarifying the question) : <?php $string ='<?php phpinfo(); ?>' ; echo $string ; ?> ??
  10. hisoka

    php curl

    yes and I would like to do it with cURL but I do not know how
  11. hisoka

    php curl

    OK suppose I have a webpage with a submit form and using cURL , I must do the following : 1) multiple 789 with 2 2) put the result in the submit form box 3)click submit to send the result to the server all these three steps should be done in one second . That is I must multiple and return the result to server in one second . Of course , it is impossible to do it manually . However , it is possible to do it using cURL . Is the right predefined constant to do it ? or is there a function or another predefined constant that can do it ? I read all of them but I could not find one that serve the context more than CURLOPT_TIMEOUT_MS and CURLOPT_TIMEOUT
  12. If , after installing and setting up everything correctly but there are still errors that should be investigated and corrected , then the problem should reside in the source code that is written by some people who neither have the courage to write , publicly :"the source code above should be corrected before it can properly compiled" nor can they compile their and provide us with a ready compiled software that can be downloaded and used . Look what happened in the Installing winpcap and configure it with cygwinwhy should I go through and research each individual error message ? it is none of my business . it is the business of the one who wrote it to correct it and not throw it away and wait from other to correct it . The idea of compiling a software from a source code is destructive for newbies like me who want to use some software . It is like some one who wants to buy a ship for sailing , he buys , for a cheap price , a ship full of holes and invest time and money and nerves to repair it and therefore pay as twice the price of a new ship . Meanwhile , he could ,from the beginning, pay third of all that money to buy a new , stable ship . In other words it is the lack of programming skills , knowledge and software that push newbies like me to try to compile a software from a source code . So the solution to these both threads is either to use a ready compiled software or learn programming languages very well and write his own program .
  13. hisoka

    php curl

    Sometime the very clear thing is the most imperceptible to a degree that you doubt on your understanding to it . When you wrote : Does it infer that it does not matter how much time it takes for data to be sent to the server and therefore if it takes the data 5 minutes or 10 minutes to be sent to a server than it is OK ? . so that is used for cause-effect . However I did not understand the cause effect relationship in your sentence .
  14. it makes good sense what you wrote but justsomeguy in the Installing winpcap and configure it with cygwin thread I got a problem with the source code , when trying to compile it , but I could do not see any one , in Google , who run into it before me . So in case I cannot find helpful resources with the problem I get and I cannot find someone who run into it before me plus , it is not the consequence of me setting it wrongly like in the thread above . How can I solve the problem ?
  15. hisoka

    php curl

    Sorry I did not understand what do you mean by this : Could you please explain further ? 2) by this : you mean that cURL can be used with other programming languages like JavaScript and C++ or what do you mean ?
  16. what do you mean by : ?? and what do you mean by the word "system"? can you specify it more word "system"?
  17. I knew that that source code is nothing more than ing piece of and crap and the one who writes it should be ashamed from putting it there to be downloaded . It made me only lost my time and my nerves for nothing
  18. You are right Justsomeguy . `Seen all these circumstances , tell me , at least , what do you suggest me to do to surpass these Cygwin compiling errors? any advice
  19. To be honest I could not find a forum that helps solving problems , specifically , about compiling in Cygwin . The majority of forums are about Linux . I like Linux a lot . However , although Cygwin commands are all Linux , in these forums , people can help only about Linux UNIX things not about compiling source code in Cygwin errors . Moreover , there is a good site which is http://stackoverflow.com But you should follow a very strict rules in how to ask a question , in properly formatting the question and even so you do not have a guarantee to get an answer and even if you get an answer , you get in two days . At least this was my experience there . They make a ing science and a political matter from putting a simple question . For me , the best Forum ever is http://w3schools.invisionzone.com . Without this forum I could not have been advancing and progressing for an inch and to be honest , during my participation in many forums , I could not find a skillful guy like you Justsomeguy . At least , until now . May be you can provide me Justsomeguy with a Cygwin compiling source code forum that you evaluate as good as http://w3schools.invisionzone.com that can help me solve these compiling Cygwin problems and errors .
  20. does all these errors emerged because I changed int main with void main and if yes so how to correct the error : basic_dump.c:99:3: error: ‘VOID’ undeclared (first use in this function) (VOID)(param); ????
  21. So I added #include "stdlib.h" and the error disappeared . However , another error emerged : basic_dump.c:99:3: error: ‘VOID’ undeclared (first use in this function) (VOID)(param); So I changed int main () with void main() and again the error disappeared . However hundred of error emerged after that : cc -g -O -I ../../include -c -o basic_dump.o basic_dump.c basic_dump.c: In function ‘main’: basic_dump.c:25:5: error: expected expression before ‘)’ token if() == -1) ^ basic_dump.c:25:12: error: expected statement before ‘)’ token if() == -1) ^ basic_dump.c:27:3: error: too few arguments to function ‘fprintf’ fprintf(); ^ basic_dump.c:28:3: error: too few arguments to function ‘exit’ exit(); ^ basic_dump.c:32:6: error: expected expression before ‘)’ token for() ^ basic_dump.c:32:6: error: expected expression before ‘)’ token basic_dump.c:34:3: error: too few arguments to function ‘printf’ printf(); ^ basic_dump.c:35:7: error: expected expression before ‘)’ token if () ^ basic_dump.c:36:4: error: too few arguments to function ‘printf’ printf()\n", d->description); ^ basic_dump.c:36:4: error: stray ‘\’ in program basic_dump.c:36:14: warning: missing terminating " character printf()\n", d->description); ^ basic_dump.c:36:4: error: missing terminating " character printf()\n", d->description); ^ basic_dump.c:38:4: error: stray ‘\’ in program printf()\n"); ^ basic_dump.c:38:14: warning: missing terminating " character printf()\n"); ^ basic_dump.c:38:4: error: missing terminating " character printf()\n"); ^ basic_dump.c:41:5: error: expected expression before ‘)’ token if() ^ basic_dump.c:43:3: error: too few arguments to function ‘printf’ printf(); ^ basic_dump.c:44:10: warning: ‘return’ with a value, in function returning void return -1; ^ basic_dump.c:47:2: error: too few arguments to function ‘printf’ printf():",i); ^ basic_dump.c:47:10: error: expected ‘;’ before ‘:’ token printf():",i); ^ basic_dump.c:47:11: warning: missing terminating " character printf():",i); ^ basic_dump.c:47:10: error: missing terminating " character printf():",i); ^ basic_dump.c:50:5: error: expected expression before ‘)’ token if() ^ basic_dump.c:52:3: error: too few arguments to function ‘printf’ printf(); ^ basic_dump.c:54:3: error: too few arguments to function ‘pcap_freealldevs’ pcap_freealldevs(); ^ In file included from ../../include/pcap.h:45:0, from basic_dump.c:9: ../../include/pcap/pcap.h:349:6: note: declared here void pcap_freealldevs(pcap_if_t *); ^ basic_dump.c:55:10: warning: ‘return’ with a value, in function returning void return -1; ^ basic_dump.c:59:6: error: expected expression before ‘)’ token for(); ^ basic_dump.c:59:6: error: expected expression before ‘)’ token basic_dump.c:71:3: error: too few arguments to function ‘fprintf’ fprintf(); ^ basic_dump.c:73:3: error: too few arguments to function ‘pcap_freealldevs’ pcap_freealldevs(); ^ In file included from ../../include/pcap.h:45:0, from basic_dump.c:9: ../../include/pcap/pcap.h:349:6: note: declared here void pcap_freealldevs(pcap_if_t *); ^ basic_dump.c:74:10: warning: ‘return’ with a value, in function returning void return -1; ^ basic_dump.c:77:2: error: too few arguments to function ‘printf’ printf(); ^ basic_dump.c:80:2: error: too few arguments to function ‘pcap_freealldevs’ pcap_freealldevs(); ^ In file included from ../../include/pcap.h:45:0, from basic_dump.c:9: ../../include/pcap/pcap.h:349:6: note: declared here void pcap_freealldevs(pcap_if_t *); ^ basic_dump.c:83:2: error: too few arguments to function ‘pcap_loop’ pcap_loop(); ^ In file included from ../../include/pcap.h:45:0, from basic_dump.c:9: ../../include/pcap/pcap.h:299:5: note: declared here int pcap_loop(pcap_t *, int, pcap_handler, u_char *); ^ basic_dump.c:85:2: error: too few arguments to function ‘pcap_close’ pcap_close(); ^ In file included from ../../include/pcap.h:45:0, from basic_dump.c:9: ../../include/pcap/pcap.h:298:6: note: declared here void pcap_close(pcap_t *); ^ basic_dump.c:86:9: warning: ‘return’ with a value, in function returning void return 0; ^ basic_dump.c: In function ‘packet_handler’: basic_dump.c:100:3: error: expected expression before ‘)’ token ()(); ^ basic_dump.c:101:3: error: expected expression before ‘)’ token ()(); ^ basic_dump.c:104:17: error: ‘header’ undeclared (first use in this function) local_tv_sec = header->ts.tv_sec; ^ basic_dump.c:104:17: note: each undeclared identifier is reported only once for each function it appears in basic_dump.c:105:8: error: too few arguments to function ‘localtime’ ltime=localtime(); ^ In file included from /usr/include/sys/types.h:20:0, from ../../include/pcap/pcap.h:46, from ../../include/pcap.h:45, from basic_dump.c:9: /usr/include/time.h:59:12: note: declared here struct tm *_EXFUN(localtime,(const time_t *_timer)); ^ basic_dump.c:106:2: error: too few arguments to function ‘strftime’ strftime(); ^ basic_dump.c:108:2: error: too few arguments to function ‘printf’ printf(); ^ GNUmakefile:17: recipe for target 'basic_dump.o' failed make: *** [basic_dump.o] Error 1
  22. Does it mean that , in w3schools forum namely this forum , I should not ask questions about Cygwin and problems of compilation?
  23. There is no executable file . I tried to compile the files in basic_dump_ex using cygwin : /cygdrive/c/WpdPack/Examples-pcap/basic_dump_ex $make but I got this : cc -g -O -mno-cygwin -I ../../include -c -o basic_dump_ex.o basic_dump_ex.c cc: error: unrecognized command line option ‘-mno-cygwin’ GNUmakefile:17: recipe for target 'basic_dump_ex.o' failed make: *** [basic_dump_ex.o] Error 1 In some articles , it is stated that deleting -mno-cygwin , solve the problem . However I cannot find it this -mno-cygwin . now I deleted the -mno-cygwin and I got a new error : cc -g -O -I ../../include -c -o basic_dump.o basic_dump.c basic_dump.c: In function ‘main’: basic_dump.c:27:3: warning: implicit declaration of function ‘exit’ [-Wimplicit-function-declaration] exit(1); ^ basic_dump.c:27:3: warning: incompatible implicit declaration of built-in function ‘exit’ basic_dump.c:27:3: note: include ‘<stdlib.h>’ or provide a declaration of ‘exit’ basic_dump.c: In function ‘packet_handler’: basic_dump.c:99:3: error: ‘VOID’ undeclared (first use in this function) (VOID)(param); ^ basic_dump.c:99:3: note: each undeclared identifier is reported only once for each function it appears in GNUmakefile:17: recipe for target 'basic_dump.o' failed make: *** [basic_dump.o] Error 1
  24. I download Apache 2.4.18 from this site : http://httpd.apache.org/download.cgi The file name I downloaded is : httpd-2.4.18.tar.bz2 I extracted it then I tried to compile it , in my windows xp 32 , using Cygwin I opened my Cygwin and went to the folder in which there are the files that should be compiled that is: /cygdrive/c/Program Files/httpd-2.4.18 First to make things more clear I will list all folders and files in httpd-2.4.18 : using ls I got : ABOUT_APACHE config.layout InstallBin.dsp README acinclude.m4 config.log LAYOUT README.cmake ap.d config.nice libhttpd.dsp README.platforms Apache.dsw config.status LICENSE ROADMAP apache_probes.d configure Makefile server Apache-apr2.dsw configure.in Makefile.in srclib build docs Makefile.win support BuildAll.dsp emacs-style modules test BuildBin.dsp httpd.dsp modules.c VERSIONING buildconf httpd.spec NOTICE CHANGES include NWGNUmakefile CMakeLists.txt INSTALL os then I used the ./configure command in Cygwin for /cygdrive/c/Program Files/httpd-2.4.18 like this : /cygdrive/c/Program Files/httpd-2.4.18 $ ./configure I did not got an error then /cygdrive/c/Program Files/httpd-2.4.18 $ make and then I got an error : make : *** No targets . Stop So I looked in this site for information about that error : https://www.gnu.org/software/make/manual/html_node/Error-Messages.html There it is mentioned the following : ‘No targets specified and no makefile found. Stop.’ ‘No targets. Stop.’ The former means that you didn’t provide any targets to be built on the command line, and make couldn’t find any makefiles to read in. The latter means that some makefile was found, but it didn’t contain any default goal and none was given on the command line. GNU make has nothing to do in these situations. See Arguments to Specify the Makefile. ( I looked there too) So I put : /cygdrive/c/Program Files/httpd-2.4.18 $ make -f Apache.dsw (target file) But I got another error : ‘missing separator. Stop.’ ‘missing separator (did you mean TAB instead of 8 spaces?). Stop.’ This means that make could not understand much of anything about the makefile line it just read. GNU make looks for various separators (:, =, recipe prefix characters, etc.) to indicate what kind of line it’s parsing. This message means it couldn’t find a valid one. One of the most common reasons for this message is that you (or perhaps your oh-so-helpful editor, as is the case with many MS-Windows editors) have attempted to indent your recipe lines with spaces instead of a tab character. In this case, make will use the second form of the error above. Remember that every line in the recipe must begin with a tab character (unless you set .RECIPEPREFIX; see Special Variables). Eight spaces do not count. See Rule Syntax According to the explanation , it seems to me that the target file I am providing to make is not the right one I am stuck and confused do not know what to do and how to compile the file . I need help
  25. I listed all the files in this directory /cygdrive/c/WpdPack/Examples-pcap/basic_dump and this is what I got : basic_dump.c basic_dump.dsp basic_dump.dsw basic_dump.vcproj GNUmakefile As you can see there is NO basic_dump with .exe extension the command : ls -l basic_dump.* gives me this : -rwxr-x---+ 1 Administrator None 2737 Dec 23 2008 basic_dump.c -rwxr-x---+ 1 Administrator None 4558 May 20 2005 basic_dump.dsp -rwxr-x---+ 1 Administrator None 543 May 20 2005 basic_dump.dsw -rwxr-x---+ 1 Administrator None 7671 Jul 24 2009 basic_dump.vcproj these commands : cd /cygdrive/c/WpdPack/ find . -name "basic_dump.*" give me this result: ./Examples-pcap/basic_dump/basic_dump.c ./Examples-pcap/basic_dump/basic_dump.dsp ./Examples-pcap/basic_dump/basic_dump.dsw ./Examples-pcap/basic_dump/basic_dump.vcproj ./Examples-remote/misc/basic_dump.c ./Examples-remote/misc/basic_dump.dsp ./Examples-remote/misc/basic_dump.vcproj Moreover , I looked for an .exe file in all the folder of WpdPack but I could not find any file with .exe extension nothing special , the problem still persists
×
×
  • Create New...