#1  
Old 11th February 2011, 02:15
otacon otacon is offline
Senior Member
 
Join Date: Sep 2010
Posts: 109
Thanks: 5
Thanked 5 Times in 5 Posts
Default $_POST script.

I have a form that where someone types the username and password they want to have and it adds a client to my ispcontrol panel. when I try to just echo $_POST["username"] it works perfectly, but when I try to add it to the example script it creates a blank client with none of the information in it.


The PHP file is:


<?php

require('soap_config.php');

$client = new SoapClient(null, array('location' => $soap_location,
'uri' => $soap_uri));

try {
if($session_id = $client->login($username,$password)) {
echo 'Login successfull. SessionID:'.$session_id.'<br />';
}

$params = array( 'server_id' => 1,
'company_name' => '$_POST["company"]',
'contact_name' => '$_POST["name"]',
'username' =>'$_POST["username"]',
'password' =>'$_POST["password"]',
'language' =>'',
'usertheme' =>'',
'street' =>'$_POST["address"]',
'zip' =>'$_POST["zipcode"]',
'city' =>'$_POST["city"]',
'state' =>'$_POST["state"]',
'country' =>'$_POST["country"]',
'telephone' =>'$_POST["telephone"]',
'mobile' =>'',
'fax' =>'',
'email' =>'hello@remcycle.net',
'internet' =>'',
'icq' =>'',
'notes' =>'Auto',
'template_master' => '1',
'template_additional' =>'',
'default_mailserver' =>'1',
'limit_maildomain' =>'1',
'limit_mailbox' =>'-1',
'limit_mailalias' =>'-1',
'limit_mailforward' =>'-1',
'limit_mailcatchall' =>'-1',
'limit_mailrouting' => '-1',
'limit_mailfilter' =>'-1',
'limit_fetchmail' =>'-1',
'limit_mailquota' =>'-1',
'limit_spamfilter_wblist' =>'-1',
'limit_spamfilter_user' =>'-1',
'limit_spamfilter_policy' =>'-1',
'default_webserver' =>'1',
'limit_web_domain' =>'-1',
'web_php_options' =>"SuPHP",
'limit_web_aliasdomain' =>'-1',
'limit_web_subdomain' =>'-1',
'limit_ftp_user' =>'-1',
'limit_shell_user' =>'-1',
'ssh_chroot' =>'None',
'default_dnsserver' =>'1',
'limit_dns_zone' =>'-1',
'limit_dns_record' =>'-1',
'limit_client' =>'0',
'default_dbserver' =>'1',
'limit_database' =>'-1',
'limit_cron' =>'0',
'limit_cron_type' =>'',
'limit_cron_frequency' =>'-1');


$reseller_id = 0;
$domain_id = $client->client_add($session_id, $reseller_id, $params);



if($client->logout($session_id)) {
echo 'Logout.<br />';
}


} catch (SoapFault $e) {
die('SOAP Error: '.$e->getMessage());
}

?>



Could you tell me if I have a php or a ispconfig issue?
Reply With Quote
Sponsored Links
  #2  
Old 11th February 2011, 12:25
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,752
Thanks: 821
Thanked 5,330 Times in 4,182 Posts
Default

Which ISPConfig version do you use?
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 11th February 2011, 21:27
otacon otacon is offline
Senior Member
 
Join Date: Sep 2010
Posts: 109
Thanks: 5
Thanked 5 Times in 5 Posts
Default

Debian server with ispconfig 3.0.3.1, currently executed an update to 3.0.3.2, I am not sure how long it take for that to execute.
Reply With Quote
  #4  
Old 13th February 2011, 21:25
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,752
Thanks: 821
Thanked 5,330 Times in 4,182 Posts
Default

The best way to update ispconfig is to use the command:

ispconfig_update.sh

on the shell as root user.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 14th February 2011, 03:15
otacon otacon is offline
Senior Member
 
Join Date: Sep 2010
Posts: 109
Thanks: 5
Thanked 5 Times in 5 Posts
Default

Yes. I finally got updated, but I still have the same issue as before... I am not sure what coding is incorrect.

Echoing the post works, so that mean php is setup correctly too, but when I try to put them in the example script above it still does not work.
Reply With Quote
  #6  
Old 14th February 2011, 09:46
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,752
Thanks: 821
Thanked 5,330 Times in 4,182 Posts
Default

Your script assumes that a template with the ID 1 gets applied:

'template_master' => '1'

so all limits that you have set are discarded and the values from that template gets used. If the template does not exist, empty values get applied. So if you dont use a template, then you should set 'template_master' => '0'
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #7  
Old 8th March 2011, 02:50
otacon otacon is offline
Senior Member
 
Join Date: Sep 2010
Posts: 109
Thanks: 5
Thanked 5 Times in 5 Posts
Default

You are right that is the issue. I have now changed that to 0 and now the information is not blank, but the post command is still not working.

All the information is $_POST["username"].

When I do the regular php by itself it works. Should I be using some other type of code or is this suppose to work with the post function?
Reply With Quote
  #8  
Old 8th March 2011, 02:58
otacon otacon is offline
Senior Member
 
Join Date: Sep 2010
Posts: 109
Thanks: 5
Thanked 5 Times in 5 Posts
 
Default

Nevermind... I have no idea what I was thinking... the variables shouldn't be in single quotes lol... fixed.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sql ledger using forum.. yurtboy1 General 19 25th December 2010 21:08
use jawstats / mawstats with ispconfig e100 Tips/Tricks/Mods 3 19th December 2010 11:33
freebsd 7, samba 3, domain controller alexdimarco Suggest HOWTO 6 5th November 2010 16:54
Companion Script #2 for The Perfect Server - Fedora 13 x86_64 [ISPConfig 3]" MrCompTech Tips/Tricks/Mods 0 10th July 2010 05:11
Internet Explorer won't connect to my server wctaelectronics Server Operation 10 27th October 2008 21:14


All times are GMT +2. The time now is 15:04.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.