Jump to content

"fopen" a litle help please


cybernet

Recommended Posts

i have this in database.php

function addNewUser($username, $password, $email){

      $time = time();

      /* If admin sign up, give admin user level */

      if(strcasecmp($username, ADMIN_NAME) == 0){

         $ulevel = ADMIN_LEVEL;

      }else{

         $ulevel = USER_LEVEL;

      }

      $q = "INSERT INTO ".TBL_USERS." VALUES ('$username', '$password', '0', $ulevel, '$email', $time)";

      return mysql_query($q, $this->connection);

   }

but after this i want to do something else with the POST data

do run this function

$f = fopen("http://example.com/userService/userservice?type=add&secret=bigsecret&username=$username&password=$password&name=$username&[email protected]");





$response = fread($f,  1024);





if (ereg('OK', $response)) {





   echo 'user was added successfully to database ';





} else {





   echo 'cant add user to database';





}





fclose($f);

Link to comment
https://forums.phpfreaks.com/topic/131099-fopen-a-litle-help-please/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.