-
Posts
12 -
Joined
-
Last visited
About gork4life
- Birthday 10/27/1978
Profile Information
-
Gender
Male
-
Location
Houston
gork4life's Achievements

Newbie (1/5)
0
Reputation
-
Ok thanks I'm tring to create a webservice in php. My servercode is <?php ini_set('soap.wsdl_cache_enabled',0); ini_set('soap.wsdl_cache_ttl',0); $soap_server = new SoapServer('Notification.wsdl'); $soap_server->addFunction('Notify'); function Notify($message) { return array('message' => $message); } $soap_server->handle(); ?> And I'm trying to create a client for the service using this code <?php include 'soap_server.php'; $soap_client = new SoapClient('https://localhost:8888/Soap/Notification.wsdl', array( 'proxy_host' => 'localhost', 'proxy_port' => '8888', 'local_cert' => 'APX_WS_API1.cer' )); try{ $result = $soap_client->__soapCall('Notify',array('message' => 'Hello World')); echo $result; }catch(SoapFault $e){ echo "Error: " . $e->faultcode; } ?> The problem is when I run this I get could not connect to host error. If I can do this with JSONP. How can I do this with the wsdl file that I have to use? Please help?
-
I'm new to soap and webservices , and wanting to know do I have to use soap with a wsdl file, or can I use something else like json?
-
I need help I'm with a table that primary keys auto-increments let's say we have five records listed with primary key as 1,2,3,4,5. What I want is when I delete lets say record 5, the next time I create a record I want it to be 5. Is this possible and is it recommended?
-
I figured it out. I added ../ in one of my files. Thanks anyway.
-
The file exists because I'm using an instance of the same class to process my form. And when I exclude the include function everything works as it should. Which is insert the form data into my database.
-
Well the think is that with out my including the class in that file. I'm including a different file to the database and it works so I'm not really understanding why I"m getting this error.
-
I'm sorry I didn't explain my problem fully. If I add the include I get this error. Warning: include(../includes/Constants.php) [function.include]: failed to open stream: No such file or directory in /var/www/ggender/Resources/User.php on line 1 If I exclude the include and just live the action attribute with the instance of the same class I have no problem and it works as intended. Basically what I'm trying to do is use the instance to process the form, and include the class so that I can use a property with in that class.
-
Can I include a class file in the same page that I use an instance of the same class with my action attribute with my form. Here's the code <?php include 'Resources/User.php';?> <html> <head> <title></title> <link href="stylesheets/styles.css" rel="stylesheet" type="text/css"/> </head> <body> <form action = "Resources/testClass.php" method="post" enctype="multipart/form-data"> <label>First Name: </label> <input type="text" name="fname" id="fname" size="25" maxlength="25"/> <label>Last Name: </label> <input type="text" name="lname" id="lname" size="25" maxlength="25"/> <label>Email: </label> <input type="text" name="email" id="email" size="25" maxlength="40"/> <label>Username: </label> <input type="text" name="username" id="username" size="25" maxlength="32"/> <label>Password: </label> <input type="password" name="password" id="password" size="25" maxlength="32"/> <label>Re-enter Password: </label> <input type="password" name="conf_pass" id="conf_pass" size="25" maxlength="32"/> <br /><br /> <input type="submit" name="submit" id="submit" value="Register"/> <input type="reset" name="reset" id="reset" value="Reset"/> </form> </body> </html>
-
how to install PHP_MYSQL driver?
gork4life replied to Aman Grover's topic in PHP Installation and Configuration
If you don't see it then just add it and restart your server. -
MySqli prepared Statements inside custom class
gork4life replied to gork4life's topic in PHP Coding Help
I figured it out last night, but thank you any way jcbones your the man. -
MySqli prepared Statements inside custom class
gork4life replied to gork4life's topic in PHP Coding Help
Thanks I did what you said and it still just connected to the database with any errors. But It's not inserting what I type into the form. Any ideas why is that. User class <?php include '../includes/Constants.php'; ?> <?php /** * Description of User * * @author Eric Evas */ class User { var $id, $fname, $lname, $email, $username, $password, $conf_pass; protected static $db_conn; //declare variables public function __construct() { $host = DB_HOST; $user = DB_USER; $pass = DB_PASS; $db = DB_NAME; //Connect to database $this->db_conn = new mysqli($host, $user, $pass, $db); //Check database connection if ($this->db_conn->connect_error) { echo 'Connection Fail: ' . mysqli_connect_error(); } else { echo 'Connected'; } } function regUser($fname, $lname, $email, $username, $password, $conf_pass) { if ($stmt = $this->db_conn->prepare("INSERT INTO USERS (user_fname,user_lname, user_email,username,user_pass) VALUES (?,?,?,?,?)")) { $stmt->bind_param('sssss', $fname, $lname, $email, $username, $password); $stmt->execute(); $stmt->store_result(); $stmt->close(); } } } ?> Instance file modified. <?php include_once 'User.php'; ?> <?php //Creating new User Object $newUser = new User(); $fname = $_POST['fname']; $lname = $_POST['lname']; $email = $_POST['email']; $username = $_POST['username']; $password = $_POST['password']; $conf_pass = $_POST['conf_pass']; $newUser->regUser($fname, $lname, $email,username, $password, $conf_pass); ?> -
I've searched all over for the past few days trying to figure out what I'm doing wrong. Basically what I'm trying to do is create a prepared statement inside my User class. I can connect to the database, but my query does not execute as expected. Here's the code for my User class <?php include '../includes/Constants.php'; ?> <?php /** * Description of User * * @author Eric Evas */ class User { var $id, $fname, $lname, $email, $username, $password, $conf_pass; protected static $db_conn; //declare variables public function __construct() { $host = DB_HOST; $user = DB_USER; $pass = DB_PASS; $db = DB_NAME; //Connect to database $this->db_conn = new mysqli($host, $user, $pass, $db); //Check database connection if ($this->db_conn->connect_error) { echo 'Connection Fail: ' . mysqli_connect_error(); } else { echo 'Connected'; } } function regUser($fname, $lname, $email, $username, $password, $conf_pass) { if ($stmt = $this->db_conn->prepare("INSERT INTO USERS (user_fname,user_lname, user_email,username,user_pass) VALUES (?,?,?,?,?)")) { $stmt->bind_param('sssss', $this->fname, $this->lname, $this->email, $this->username, $this->password); $stmt->execute(); $stmt->store_result(); $stmt->close(); } } } ?> And here's the file that I created to instantiate an instance of the user class. <?php include_once 'User.php'; ?> <?php //Creating new User Object $newUser = new User(); $newUser->fname = $_POST['fname']; $newUser->lname = $_POST['lname']; $newUser->email = $_POST['email']; $newUser->username = $_POST['username']; $newUser->password = $_POST['password']; $newUser->conf_pass = $_POST['conf_pass']; $newUser->regUser($newUser->fname, $newUser->lname, $newUser->email, $newUser->username, $newUser->password, $newUser->conf_pass); ?> And lastly heres the form that I want to get info from the user to insert into the database <html> <head> <title></title> <link href="stylesheets/styles.css" rel="stylesheet" type="text/css"/> </head> <body> <form action = "Resources/testClass.php" method="post" enctype="multipart/form-data"> <label>First Name: </label> <input type="text" name="fname" id="fname" size="25" maxlength="25"/> <label>Last Name: </label> <input type="text" name="lname" id="lname" size="25" maxlength="25"/> <label>Email: </label> <input type="text" name="email" id="email" size="25" maxlength="40"/> <label>Username: </label> <input type="text" name="username" id="username" size="25" maxlength="32"/> <label>Password: </label> <input type="password" name="password" id="password" size="25" maxlength="32"/> <label>Re-enter Password: </label> <input type="password" name="conf_pass" id="conf_pass" size="25" maxlength="32"/> <br /><br /> <input type="submit" name="submit" id="submit" value="Register"/> <input type="reset" name="reset" id="reset" value="Reset"/> </form> </body> </html>