Jump to content

fishtank22

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

fishtank22's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. First of let me get this out in the open... I normally use PHP on *nix machines and with apache. this is a rare occasion. anyway. I wanted to avoid using VBSCRIPT to process a local script running on a win xp pro box. Being that I know php pretty well, I thought I might try it to solve the problem of not knowing vbscript. I have it running fine on this machine. even have it so I can just type in the php script name instead of c:/php5/php.exe before the script. Cool stuff. I need to call a php script on another server when this runs and receive a response. (preferrably using POST). I had a test working with vbscript using MS's XMLHTTP. Not knowing what else to use. I got a quick test working with cURL but it doesnt seem to like the curl_setopt settings. without them, it calls the page (As GET) and receives a response. So my question is. is there a better method than CURL to receive a response from a script running on the command line? and how can I get it to use POST if I cant use curl_setopt. Thanks for any help! Fish ><>
  2. Thanks... Yeah, I kept in simple for the example here, but thats what I was thinking. I'm gonna give it a shot now. thanks a lot guys. I really appreciate it. Fish
  3. Really? Huh, I thought that was a problem. I can see in this case the chance of it even looping though more than 1x is rare, but there are some functions where this can be a problem. Or maybe I'm just paranoid. Thanks for the feedback! [!--quoteo(post=383608:date=Jun 14 2006, 12:06 AM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ Jun 14 2006, 12:06 AM) [snapback]383608[/snapback][/div][div class=\'quotemain\'][!--quotec--] That is recursion, and surely I don't consider it bad coding. Indeed, I've always found recursive functions beautiful [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /] [/quote]
  4. Hey everyone.... I have a project where I add new records into MYSQL. Along with the standard autoincrement unique id, I also would like to have a 6 digit alphanumeric code that is associated with each record (which would also need to be unique. I have the script to create the unique id: [code]$token = substr(md5(uniqid(rand(), true)),0,6);  // creates a 6 digit token[/code] I would need to query the DB to ensure that the number hasn't been used already. Sure its like a billion to one, but its the right thing to do. My question is. If the value is taken, can I call the same function again from within itself, or is that bad coding? [code] function generateUniqueID () {    $token = substr(md5(uniqid(rand(), true)),0,6);  // creates a 6 digit token    $query = "SELECT count(*) FROM table WHERE code = $token";    $result = mysql_query($query, $connection) or die(mysql_error());    $numResults = mysql_num_rows($result);    if (!$numResults) {       generateUniqueID();    } } [/code] Also, if your wondering why I dont go with the entire 32 character md5 string. Its because the code needs to be short enough for people to be able to enter it easily. Any guidance would be appreciated.
  5. Hey everyone. I recently got a hosted root linux server. I believe it came without SOAP configured with it. I'm not 100% sure what to do to include it, but from php.net is ways: "This extension is only available if PHP was configured with --enable-soap." So my question is, what is the right proceedure to get this working can someone walk me through it? I have a 1and1 linux box with PLESK8 installed. The server has PHP5 and Apache2. I'd like to build it exactly how it is now but with SOAP enabled. If this helps, my phpinfo() file shows: [code] './configure' '--build=i386-redhat-linux' '--host=i386-redhat-linux' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-kerberos' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--with-mime-magic=/etc/httpd/conf/magic' '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml' '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--without-odbc' '--disable-dom' '--disable-dba' [/code] Any help would be GREATLY appreciated!
×
×
  • 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.