Get-vmnetworkadapterextendedacl cmdlet in php script
Hi friends,
I need to call get-vmnetworkadapterextendedacl command from PHP page. so, with the help of http://theboywonder.co.uk/2012/07/29/executing-powershell-using-php-and-iis/ web page i wrote following 2 scripts.
PHP page (index.php)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Testing PowerShell</title>
</head>
<body>
<?php
// If there was no submit variable passed to the script (i.e. user has visited the page without clicking submit), display the form:
if(!isset($_POST["submit"]))
?>
<form name="testForm" id="testForm" action="index.php" method="post" />
Your name: <input type="text" name="username" id="username" maxlength="20" /><br />
<input type="submit" name="submit" id="submit" value="Do stuff" />
</form>
<?php
// Else if submit was pressed, check if all of the required variables have a value:
elseif((isset($_POST["submit"])) && (!empty($_POST["username"])))
// Get the variables submitted by POST in order to pass them to the PowerShell script:
$username = $_POST["username"];
// Best practice tip: We run out POST data through a custom regex function to clean any unwanted characters, e.g.:
// $username = cleanData($_POST["username"]);
// Path to the PowerShell script. Remember double backslashes:
$psScriptPath = "F:\\webbased\\TheSite\\get-list.ps1";
// Execute the PowerShell script, passing the parameters:
$query = shell_exec("powershell -command $psScriptPath -username '$username'< NUL");
echo $query;
// Else the user hit submit without all required fields being filled out:
else
echo "Sorry, you did not complete all required fields. Please go back and try again.";
?>
</body>
</html>
Get-list.ps1 script
param(
[string]$username
# Increase buffer width/height to avoid PowerShell from wrapping the text before
# sending it back to PHP (this results in weird spaces).
$pshost = Get-Host
$pswindow = $pshost.ui.rawui
$newsize = $pswindow.buffersize
#$newsize.height = 30000
#$newsize.width = 40000
$pswindow.buffersize = $newsize
Write-Output "Hello $username <br />"
# Get a list of running existing ACL:
$processes = get-vmnetworkadapterextendedacl
# Write them out into a table with the columns you desire:
Write-Output "<table>"
Write-Output "<thead>"
Write-Output " <tr>"
Write-Output " <th>ParentAdapter</th>"
Write-Output " <th>Direction</th>"
Write-Output " <th>Action</th>"
#Write-Output " <th>LocalIPAddress</th>"
#Write-Output " <th>RemoteIPAddress</th>"
#Write-Output " <th>LocalPort</th>"
#Write-Output " <th>RemotePort</th>"
#Write-Output " <th>Protocol</th>"
#Write-Output " <th>Weight</th>"
#Write-Output " <th>Stateful</th>"
Write-Output " </tr>"
Write-Output "</thead>"
Write-Output "<tfoot>"
Write-Output " <tr>"
Write-Output " <td> </td>"
Write-Output " <td> </td>"
Write-Output " <td> </td>"
#Write-Output " <td> </td>"
#Write-Output " <td> </td>"
#Write-Output " <td> </td>"
#Write-Output " <td> </td>"
#Write-Output " <td> </td>"
#Write-Output " <td> </td>"
#Write-Output " <td> </td>"
Write-Output " </tr>"
Write-Output "</tfoot>"
Write-Output "<tbody>"
foreach($process in $processes)
Write-Output " <tr>"
Write-Output " <td>$($process.ParentAdapter)</td>"
Write-Output " <td>$($process.Direction)</td>"
Write-Output " <td>$($process.Action)</td>"
#Write-Output " <td>$($process.LocalIPAddress)</td>"
#Write-Output " <td>$($process.RemoteIPAddress)</td>"
#Write-Output " <td>$($process.LocalPort)</td>"
#Write-Output " <td>$($process.RemotePort)</td>"
#Write-Output " <td>$($process.Protocol)</td>"
#Write-Output " <td>$($process.Weight)</td>"
#Write-Output " <td>$($process.Stateful)</td>"
Write-Output " </tr>"
Write-Output "</tbody>"
Write-Output "</table>"
#*=============================================================================
#* END SCRIPT BODY
#*=============================================================================
#*=============================================================================
#* END OF SCRIPT
#*=============================================================================
if i execute this powershell script in powershell ISE, it will correctly gives the out put in html table but not in PHP page. most weird issue is if i replace different powershell cmdlet instead of get-vmnetworkadapterextendedacl (eg. Get-process) then the
output is correctly displaying in php page. I used php 5.5 installed by MS WPI on windows server 2012 R2
1. Where does i miss the point ?
2. Do we need additional security config to execute get-vmnetworkadapterextendedacl cmdlet ?
Its a big help experts...
Regards
Gayan
Gayan attygala
I don't know if this has anything to do with why the output isn't correct, but you can more easily convert the data to HTML like this:
Write-Output (get-vmnetworkadapterextendedacl | select ParentAdapter,Direction,Action,LocalIPAddress,RemoteIPAddress,LocalPort,RemotePort,Protocol,Weight,Stateful | ConvertTo-HTML)
Using that line will eliminate everything from $processes = to the end of the script.
I hope this post has helped!
Similar Messages
-
Hi,
I'm trying to get PHP and Flex to work with one another. I
know that my program is getting the result, because if I change the
XML to be invalid, my program will throw an error that says just
that. However... I can't use the data that I am getting back from
the PHP script. I have a the [httpService].lastResult.[blah].[blah]
bound to a datagrid, but no matter what I try it isn't showing up.
I've tried calling the httpService send() on both creationComplete
and a button click.
Any ideas what my problem could be? The documentation isn't
helping me any :(Please post your code for your dataGrid and your PHP or a
sample of the returned XML. Without code, it is hard to say where
the problem is, but it seems like the issue is in your
[httpService].lastResult.[blah].[blah] syntax. It helps to set a
result event for PHP calls that you then bind to your dataGrid
rather than using the lastResult method which is hard to debug:
private function phpResult(evt:ResultEvent):void {
myDataGrid.dataProvider = evt.result;
But post your code and I'm sure we can figure out the
problem.
Vygo -
How do I execute a PHP script on a remote server?
I have a PHP script that sends a confirmation email to guest users that fill out one of my forms. The script runs fine when I test it, but when it is called from a custom JSP, Vibe blocks it from running. I understand that what I want to do is to most likely to use a remote application, but I don't want to send data back and forth and all the examples use java servlets, I just simply want to run my script without Vibe blocking it. Is there a easier way to do this? or can someone point me in the right direction?
Vibe is not configured to run PHP scripts so you cannot run your script from custom jsp.
You have already PHP script running on the server and running it as remote application is realy easy. All you have to do is to get request paramater in PHP script, register remote application in Vibe and in some point call remote application (you can do it also from custom jsp).
Regards
Pawel -
Webserver on DMZ cannot send email via php script using SMTP (cisco firewall pix 515e)
Hello,
I have two web servers that are sitting in a DMZ behind a Cisco Firewall PIX 515e. The webservers appear to be configured correctly as our website and FTP website are up. On two of our main website, we have two contact forms that use a simple html for to call a php script that uses smtp as its mailing protocol. Since, I am not the network administrator, I don't quite understand how to read the current configurations on the firewall, but I suspect that port 25 is blocked, which prevents the script from actually working or sending out emails. What I've done to narrow the problem done is the following: I used a wamp server to test our scripts with our smtp servers settings, was able to successfully send an email out to both my gmail and work place accounts. Currently, we have backupexec loaded on both of these servers, and when I try to send out an alert I never receive it. I think because port 25 is closed on both of those servers. I will be posting our configuration. if anyone can take a look and perhaps explain to me how I can change our webservers to communicate and successfully deliver mail via that script, I would gladly appreciate it. our IP range is 172.x.x.x, but it looks like our webservers are using 192.x.x.x with NAT in place. Please someone help.
Thanks,
Jeff Mateo
PIX Version 6.3(4)
interface ethernet0 100full
interface ethernet1 100full
interface ethernet2 100full
nameif ethernet0 outside security0
nameif ethernet1 inside security100
nameif ethernet2 DMZ security50
enable password GFO9OSBnaXE.n8af encrypted
passwd GFO9OSBnaXE.n8af encrypted
hostname morrow-pix-ct
domain-name morrowco.com
clock timezone EST -5
clock summer-time EDT recurring
fixup protocol dns maximum-length 512
fixup protocol ftp 21
fixup protocol h323 h225 1720
fixup protocol h323 ras 1718-1719
fixup protocol http 80
fixup protocol rsh 514
fixup protocol rtsp 554
fixup protocol sip 5060
fixup protocol sip udp 5060
fixup protocol skinny 2000
no fixup protocol smtp 25
fixup protocol sqlnet 1521
fixup protocol tftp 69
names
name 12.42.47.27 LI-PIX
name 172.20.0.0 CT-NET
name 172.23.0.0 LI-NET
name 172.22.0.0 TX-NET
name 172.25.0.0 NY-NET
name 192.168.10.0 CT-DMZ-NET
name 1.1.1.1 DHEC_339849.ATI__LEC_HCS722567SN
name 1.1.1.2 DHEC_339946.ATI__LEC_HCS722632SN
name 199.191.128.105 web-dns-1
name 12.127.16.69 web-dns-2
name 12.3.125.178 NY-PIX
name 64.208.123.130 TX-PIX
name 24.38.31.80 CT-PIX
object-group network morrow-net
network-object 12.42.47.24 255.255.255.248
network-object NY-PIX 255.255.255.255
network-object 64.208.123.128 255.255.255.224
network-object 24.38.31.64 255.255.255.224
network-object 24.38.35.192 255.255.255.248
object-group service morrow-mgmt tcp
port-object eq 3389
port-object eq telnet
port-object eq ssh
object-group network web-dns
network-object web-dns-1 255.255.255.255
network-object web-dns-2 255.255.255.255
access-list out1 permit icmp any any echo-reply
access-list out1 permit icmp object-group morrow-net any
access-list out1 permit tcp any host 12.193.192.132 eq ssh
access-list out1 permit tcp any host CT-PIX eq ssh
access-list out1 permit tcp any host 24.38.31.72 eq smtp
access-list out1 permit tcp any host 24.38.31.72 eq https
access-list out1 permit tcp any host 24.38.31.72 eq www
access-list out1 permit tcp any host 24.38.31.70 eq www
access-list out1 permit tcp any host 24.38.31.93 eq www
access-list out1 permit tcp any host 24.38.31.93 eq https
access-list out1 permit tcp any host 24.38.31.93 eq smtp
access-list out1 permit tcp any host 24.38.31.93 eq ftp
access-list out1 permit tcp any host 24.38.31.93 eq domain
access-list out1 permit tcp any host 24.38.31.94 eq www
access-list out1 permit tcp any host 24.38.31.94 eq https
access-list out1 permit tcp any host 24.38.31.71 eq www
access-list out1 permit tcp any host 24.38.31.71 eq 8080
access-list out1 permit tcp any host 24.38.31.71 eq 8081
access-list out1 permit tcp any host 24.38.31.71 eq 8090
access-list out1 permit tcp any host 24.38.31.69 eq ssh
access-list out1 permit tcp any host 24.38.31.94 eq ftp
access-list out1 permit tcp any host 24.38.31.92 eq 8080
access-list out1 permit tcp any host 24.38.31.92 eq www
access-list out1 permit tcp any host 24.38.31.92 eq 8081
access-list out1 permit tcp any host 24.38.31.92 eq 8090
access-list out1 permit tcp any host 24.38.31.93 eq 3389
access-list out1 permit tcp any host 24.38.31.92 eq https
access-list out1 permit tcp any host 24.38.31.70 eq https
access-list out1 permit tcp any host 24.38.31.74 eq www
access-list out1 permit tcp any host 24.38.31.74 eq https
access-list out1 permit tcp any host 24.38.31.74 eq smtp
access-list out1 permit tcp any host 24.38.31.75 eq https
access-list out1 permit tcp any host 24.38.31.75 eq www
access-list out1 permit tcp any host 24.38.31.75 eq smtp
access-list out1 permit tcp any host 24.38.31.70 eq smtp
access-list out1 permit tcp any host 24.38.31.94 eq smtp
access-list dmz1 permit icmp any any echo-reply
access-list dmz1 deny ip any 10.0.0.0 255.0.0.0
access-list dmz1 deny ip any 172.16.0.0 255.240.0.0
access-list dmz1 deny ip any 192.168.0.0 255.255.0.0
access-list dmz1 permit ip any any
access-list dmz1 deny ip any any
access-list nat0 permit ip CT-NET 255.255.0.0 192.168.220.0 255.255.255.0
access-list nat0 permit ip host 172.20.8.2 host 172.23.0.2
access-list nat0 permit ip CT-NET 255.255.0.0 LI-NET 255.255.0.0
access-list nat0 permit ip CT-NET 255.255.0.0 NY-NET 255.255.0.0
access-list nat0 permit ip CT-NET 255.255.0.0 TX-NET 255.255.0.0
access-list vpn-split-tun permit ip CT-NET 255.255.0.0 192.168.220.0 255.255.255
.0
access-list vpn-split-tun permit ip CT-DMZ-NET 255.255.255.0 192.168.220.0 255.2
55.255.0
access-list vpn-dyn-match permit ip any 192.168.220.0 255.255.255.0
access-list vpn-ct-li-gre permit gre host 172.20.8.2 host 172.23.0.2
access-list vpn-ct-ny permit ip CT-NET 255.255.0.0 NY-NET 255.255.0.0
access-list vpn-ct-ny permit ip CT-DMZ-NET 255.255.255.0 NY-NET 255.255.0.0
access-list vpn-ct-tx permit ip CT-NET 255.255.0.0 TX-NET 255.255.0.0
access-list vpn-ct-tx permit ip CT-DMZ-NET 255.255.255.0 TX-NET 255.255.0.0
access-list static-dmz-to-ct-2 permit ip host 192.168.10.141 CT-NET 255.255.248.
0
access-list nat0-dmz permit ip CT-DMZ-NET 255.255.255.0 192.168.220.0 255.255.25
5.0
access-list nat0-dmz permit ip CT-DMZ-NET 255.255.255.0 LI-NET 255.255.0.0
access-list nat0-dmz permit ip CT-DMZ-NET 255.255.255.0 NY-NET 255.255.0.0
access-list nat0-dmz permit ip CT-DMZ-NET 255.255.255.0 TX-NET 255.255.0.0
access-list static-dmz-to-ct-1 permit ip host 192.168.10.140 CT-NET 255.255.248.
0
access-list static-dmz-to-li-1 permit ip CT-DMZ-NET 255.255.255.0 CT-NET 255.255
.248.0
access-list vpn-ct-li permit ip CT-NET 255.255.0.0 LI-NET 255.255.0.0
access-list vpn-ct-li permit ip CT-DMZ-NET 255.255.255.0 LI-NET 255.255.0.0
access-list vpn-ct-li permit ip host 10.10.2.2 host 10.10.1.1
access-list in1 permit tcp host 172.20.1.21 any eq smtp
access-list in1 permit tcp host 172.20.1.20 any eq smtp
access-list in1 deny tcp any any eq smtp
access-list in1 permit ip any any
access-list in1 permit tcp any any eq smtp
access-list cap4 permit ip host 172.20.1.82 host 192.168.220.201
access-list cap2 permit ip host 172.20.1.82 192.168.220.0 255.255.255.0
access-list in2 deny ip host 172.20.1.82 any
access-list in2 deny ip host 172.20.1.83 any
access-list in2 permit ip any any
pager lines 43
logging on
logging timestamp
logging buffered notifications
logging trap notifications
logging device-id hostname
logging host inside 172.20.1.22
mtu outside 1500
mtu inside 1500
mtu DMZ 1500
ip address outside CT-PIX 255.255.255.224
ip address inside 172.20.8.1 255.255.255.0
ip address DMZ 192.168.10.1 255.255.255.0
ip audit info action alarm
ip audit attack action alarm
ip local pool ctpool 192.168.220.100-192.168.220.200
ip local pool ct-thomson-pool-201 192.168.220.201 mask 255.255.255.255
pdm history enable
arp timeout 14400
global (outside) 1 24.38.31.81
nat (inside) 0 access-list nat0
nat (inside) 1 CT-NET 255.255.0.0 2000 10
nat (DMZ) 0 access-list nat0-dmz
static (inside,DMZ) CT-NET CT-NET netmask 255.255.0.0 0 0
static (inside,outside) 24.38.31.69 172.20.8.2 netmask 255.255.255.255 0 0
static (DMZ,outside) 24.38.31.94 192.168.10.141 netmask 255.255.255.255 0 0
static (inside,outside) 24.38.31.71 172.20.1.11 dns netmask 255.255.255.255 0 0
static (DMZ,outside) 24.38.31.93 192.168.10.140 netmask 255.255.255.255 0 0
static (DMZ,inside) 24.38.31.93 access-list static-dmz-to-ct-1 0 0
static (DMZ,inside) 24.38.31.94 access-list static-dmz-to-ct-2 0 0
static (inside,outside) 24.38.31.92 172.20.1.56 netmask 255.255.255.255 0 0
static (DMZ,outside) 24.38.31.91 192.168.10.138 netmask 255.255.255.255 0 0
static (DMZ,outside) 24.38.31.90 192.168.10.139 netmask 255.255.255.255 0 0
static (inside,outside) 24.38.31.72 172.20.1.20 netmask 255.255.255.255 0 0
static (inside,outside) 24.38.31.73 172.20.1.21 netmask 255.255.255.255 0 0
static (inside,outside) 24.38.31.70 172.20.1.91 netmask 255.255.255.255 0 0
static (DMZ,outside) 24.38.31.88 192.168.10.136 netmask 255.255.255.255 0 0
static (DMZ,outside) 24.38.31.89 192.168.10.137 netmask 255.255.255.255 0 0
static (inside,outside) 24.38.31.74 172.20.1.18 netmask 255.255.255.255 0 0
static (inside,outside) 24.38.31.75 172.20.1.92 netmask 255.255.255.255 0 0
access-group out1 in interface outside
access-group dmz1 in interface DMZ
route outside 0.0.0.0 0.0.0.0 24.38.31.65 1
route inside 10.10.2.2 255.255.255.255 172.20.8.2 1
route inside CT-NET 255.255.248.0 172.20.8.2 1
timeout xlate 3:00:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 rpc 0:10:00 h225 1:00:00
timeout h323 0:05:00 mgcp 0:05:00 sip 0:30:00 sip_media 0:02:00
timeout uauth 0:05:00 absolute
aaa-server TACACS+ protocol tacacs+
aaa-server TACACS+ max-failed-attempts 3
aaa-server TACACS+ deadtime 10
aaa-server RADIUS protocol radius
aaa-server RADIUS max-failed-attempts 3
aaa-server RADIUS deadtime 10
aaa-server LOCAL protocol local
aaa-server ct-rad protocol radius
aaa-server ct-rad max-failed-attempts 2
aaa-server ct-rad deadtime 10
aaa-server ct-rad (inside) host 172.20.1.22 morrow123 timeout 7
aaa authentication ssh console LOCAL
aaa authentication http console LOCAL
aaa authentication serial console LOCAL
aaa authentication telnet console LOCAL
http server enable
http 173.220.252.56 255.255.255.248 outside
http 65.51.181.80 255.255.255.248 outside
http 208.65.108.176 255.255.255.240 outside
http CT-NET 255.255.0.0 inside
no snmp-server location
no snmp-server contact
snmp-server community m0rroW(0
no snmp-server enable traps
floodguard enable
sysopt connection permit-ipsec
sysopt connection permit-pptp
crypto ipsec transform-set 3des-sha esp-3des esp-sha-hmac
crypto ipsec transform-set 3des-md5 esp-3des esp-md5-hmac
crypto dynamic-map dyn_map 20 match address vpn-dyn-match
crypto dynamic-map dyn_map 20 set transform-set 3des-sha
crypto map ct-crypto 10 ipsec-isakmp
crypto map ct-crypto 10 match address vpn-ct-li-gre
crypto map ct-crypto 10 set peer LI-PIX
crypto map ct-crypto 10 set transform-set 3des-sha
crypto map ct-crypto 15 ipsec-isakmp
crypto map ct-crypto 15 match address vpn-ct-li
crypto map ct-crypto 15 set peer LI-PIX
crypto map ct-crypto 15 set transform-set 3des-sha
crypto map ct-crypto 20 ipsec-isakmp
crypto map ct-crypto 20 match address vpn-ct-ny
crypto map ct-crypto 20 set peer NY-PIX
crypto map ct-crypto 20 set transform-set 3des-sha
crypto map ct-crypto 30 ipsec-isakmp
crypto map ct-crypto 30 match address vpn-ct-tx
crypto map ct-crypto 30 set peer TX-PIX
crypto map ct-crypto 30 set transform-set 3des-sha
crypto map ct-crypto 65535 ipsec-isakmp dynamic dyn_map
crypto map ct-crypto client authentication ct-rad
crypto map ct-crypto interface outside
isakmp enable outside
isakmp key ******** address LI-PIX netmask 255.255.255.255 no-xauth no-config-mo
de
isakmp key ******** address 216.138.83.138 netmask 255.255.255.255 no-xauth no-c
onfig-mode
isakmp key ******** address NY-PIX netmask 255.255.255.255 no-xauth no-config-mo
de
isakmp key ******** address TX-PIX netmask 255.255.255.255 no-xauth no-config-mo
de
isakmp identity address
isakmp nat-traversal 20
isakmp policy 10 authentication pre-share
isakmp policy 10 encryption 3des
isakmp policy 10 hash sha
isakmp policy 10 group 2
isakmp policy 10 lifetime 86400
isakmp policy 20 authentication pre-share
isakmp policy 20 encryption 3des
isakmp policy 20 hash md5
isakmp policy 20 group 2
isakmp policy 20 lifetime 86400
isakmp policy 30 authentication pre-share
isakmp policy 30 encryption 3des
isakmp policy 30 hash md5
isakmp policy 30 group 1
isakmp policy 30 lifetime 86400
vpngroup remotectusers address-pool ctpool
vpngroup remotectusers dns-server 172.20.1.5
vpngroup remotectusers wins-server 172.20.1.5
vpngroup remotectusers default-domain morrowny.comAmit,
I applaud your creativity in seeking to solve your problem, however, this sounds like a real mess in the making. There are two things I don't like about your approach. One, cron -> calling Java -> calling PHP -> accessing database, it's just too many layers, in my opinion, where things can go wrong. Two it seems to me that you are exposing data one your website (with the PHP) that you may not want expose and this is an important consideration when you are dealing with emails and privacy and so on.
I think the path of least resistance would be to get a new user account added to the MySQL database that you can access remotely with your Java program. This account can be locked down for read only access and be locked down to the specific IP or IP range that your Java program will be connecting from.
Again I applaud your creativity but truly this seems like a hack because of the complexity and security concerns you are introducing and I think is a path to the land of trouble. Hopefully you will be able to get a remote account set up. -
Send PDF form to e-mail as attachment with a PHP script on the server
Hi,
For several days I've been searching though the internet looking for a solution, a quite simple one in my opinion, but I got a little desperate not getting any result I want.
Okay. The Situation.
I have a PDF form to order sandwiches and drinks.
The PDF has serveral area's and columns where customers fill in the amount of the products they would like to order.
At a position of a field, the kitchen can almost blindly see what products a customer ordered.
Therefore, when someone fills in the form, I want to send the filled PDF by e-mail to the kitchen's e-mail adress. And important: the PDF in the kitchen's mailbox should be completely identical to the form the customer filled in.
So, I have an Order button in my form. I set the action as 'Submit a form'.
In the settings under 'Enter a URL for this link' I used just some PHP mailer script I also use on my website contact form.
IF I check 'HTML' under 'Export Format' the PHP mailer works fine. I receive an HTML e-mail listed the ordered products.
BUT
I do want the original filled PDF in my mailbox instead of an HTML e-mail.
So, for 'Export Format' I checked 'PDF The Complete Document'.
But then my PHP mailer script doesn't work anymore.
It gives errors like 'no valid e-mail adres' , etcetera etcetera.
Who has a solution?
Who has a working standard PHP script for me what just sends the kitchen an empty mail with the original PDF as attachment?!
There is no need to use any database or other more complex functionality. Just mail the filled PDF.You can submit whole PDF format as long as you enable usage rights on the PDF.
Normally Adobe Reader users can only submit the data, XFDF, FDF, XDP, XML.
To enable usage rights on the PDF you will need to use Adobe Acrobat Std/Pro.
As for the PHP Script; it depends on your PHP web server capabilities.
The script will be slightly different, if the server uses PHP Mail or PHP PEAR.
Just attach the submission to an email and send.
If the client is submitting the form from a standalone pdf reader app, you can also respond with a success or failure FDF \status message; otherwise, you can redirect to a success / failure URL.
For more information and online examples:
http://www.pdfemail.net/examples/ -
Speeding up the Get-MailboxStatistics cmdlet for ~19K mailboxes.
Greetings,
While this is partially a PowerShell scripting question, I am posting it in the Exchange 2010 forum because the issues I believe center around the Get-MailboxStatistics itself, and the speed of my scripts in Exchange 2010 (possibly
due to the additional overhead in remote PowerShelling).
In my Exchange 2010 system we have ~19,000 mailboxes spread accross multiple DAG nodes, and ever since we upgraded from Exchange 2007 to Exchange 2010, gathering all of the mailboxes and then gathering their statistics takes almost
twice as long. For example a script that used to take ~45 minutes in Exchange 2007, takes about an hour and a ½.
The issue I am running into when clocking core aspects of a mailbox data gathering scripts is that the Get-MailboxStatistics seems to be taking an excessively long period of time, and I am hoping someone can help me figure out a
way to speed up the process.
For example this is a boiled down script I created, where I ripped out a ton of other things and just focused on the Get-Mailbox and Get-MailboxStatistics commands:
$BaseOU
=
"Customers"
# Capture the date and time in a variable using the "Fri 11/01/2010 6:00 AM" format.
$DateTime
=
Get-Date
-Format
"ddd MM/dd/yyyy h:mm tt"
# Select a single domain controller to use for all the queries (to avoid mid AD replication inconsistencies)
from the environment variable LOGONSERVER - this ensures the variable will always be dynamically updated.
$DomainController
= ($Env:LogonServer).Substring(2)
# Set the loop count to 0 so it can be used to track the percentage of completion.
$LoopCount
= 0
# Start tracking the time this script takes to run.
$StopWatch1
=
New-Object
System.Diagnostics.Stopwatch
$StopWatch1.Start()
# Get the mailbox info for all IHS customer mailboxes.the storage limit is Prohibit send or mailbox disabled
Write-Host
-ForegroundColor
Green
"Beginning mailbox gathering. In a short while a progress bar will appear."
$GatheredMailboxes
=
Get-Mailbox
-ResultSize:Unlimited
-OrganizationalUnit
"ADDomain.com/$BaseOU"
-DomainController
$DomainController |
Select Identity,DisplayName,ProhibitSendQuota
Write-Host
-ForegroundColor
Green
"Mailbox data gathering is complete."
$StopWatch1.Stop()
$StopWatch2
=
New-Object
System.Diagnostics.Stopwatch
$StopWatch2.Start()
Foreach ($Mailbox
in
$GatheredMailboxes) {
# Show a status bar for progress while the mailbox data is collected.
$PercentComplete
= [Math]::Round(($LoopCount++
$GatheredMailboxes.Count
* 100),1)
$CurrentMBDisplay
=
$Mailbox.DisplayName
Write-Progress
-Activity
"Mailbox Data Gathering in Progress"
-PercentComplete
$PercentComplete
`
-Status
"$PercentComplete% Complete"
-CurrentOperation
"Current Mailbox: $CurrentMBDisplay"
#Get the mailbox statistics for each mailbox gathered above.
$MailboxStats
=
Get-MailboxStatistics
$Mailbox.Identity |
Select StorageLimitStatus,TotalItemSize
# Proceed only if the the mailbox statistics show the storage limit is Prohibit Send or Mailbox Disabled.
# Write-Host "Stats for"$Mailbox.DisplayName"are Limit ="$MailboxStats.StorageLimitStatus"and Size ="$MailboxStats.TotalItemSize.Value.ToMB()"MB."
# Calculate the amount of time the script took to run and write the information to the screen.
$StopWatch2.Stop()
$ElapsedTime
=
$StopWatch1.Elapsed
Write-Host
"he mailbox gathering took"
$ElapsedTime.Hours
"hours,"
$ElapsedTime.Minutes
"minutes, and"
$ElapsedTime.Seconds
`
"seconds to run."
$ElapsedTime
=
$StopWatch2.Elapsed
Write-Host
"The foreach loop took"
$ElapsedTime.Hours
"hours,"
$ElapsedTime.Minutes
"minutes, and"
$ElapsedTime.Seconds
`
"seconds to run."
Using the two stop clocks, I was able to see that the Get-Mailbox of all mailboxes took ~9 minutes. That isn’t lightning fast, but it isn’t unreasonable.
The issue comes in where the Foreach loop with the Get-MailboxStatistics took ~53 minutes, and I am sure some of the mailbox data was cached on the servers from my various tests so it would probably take even longer with a cold
run.
I did some digging around and I really couldn’t find anything on how to speed up the Get-MailboxStatistics, and the only thing I found was this link:
http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/9ceefddd-7a59-44ec-8fc0-8de244acb58b
However I am not clear on how moving the Get-MailboxStatistics into the Get-Mailbox syntax (which is odd to me in general) would speed things up if I still have to have a foreach loop to process the data a little bit and add the
users to a datatable. That discussion also made think the foreach loop itself is slowing things down but unclear as to how/why if that is true.
Can someone help share some ideas on how to speed up this process? I think there are some other things I could try but I can’t think of them.
Thank you in advance.I think it's impossible to speed up the Get-MailboxStatistics when it is being called for each and every mailbox individually.
I read somewhere in other posts people were having better performance by calling the cmdlet against an entire database or server so I gave it a shot with this code:
$DAGS = "EXCHDAG1"
# Start tracking the time this script takes to run.
$StopWatch = New-Object System.Diagnostics.Stopwatch
$StopWatch.Start()
$MailboxStatistics = New-Object System.Data.DataTable “MailboxStatistics”
$MailboxStatistics.Columns.Add("TotalitemSize",[String]) | Out-Null
$MailboxStatistics.Columns.Add("ItemCount",[String]) | Out-Null
$MailboxStatistics.Columns.Add("LastLogonTime",[String]) | Out-Null
$MailboxStatistics.Columns.Add("LastLogoffTime",[String]) | Out-Null
$MailboxStatistics.Columns.Add("MailboxGUID",[String]) | Out-Null
$MailboxStatistics.PrimaryKey = $MailboxStatistics.Columns["MailboxGUID"]
ForEach ($DAGServer in (Get-DatabaseAvailabilityGroup $DAGS).Servers) {
ForEach ($MailboxStats in (Get-MailboxStatistics -Server $DAGServer.Name | Where {$_.DisconnectDate -eq $Null})) {
$NewMBXStatsDTRow = $MailboxStatistics.NewRow()
$NewMBXStatsDTRow.TotalitemSize = $MailboxStats.TotalItemSize
$NewMBXStatsDTRow.ItemCount = $MailboxStats.ItemCount
$NewMBXStatsDTRow.LastLogonTime = $MailboxStats.LastLogonTime
$NewMBXStatsDTRow.LastLogoffTime = $MailboxStats.LastLogoffTime
$NewMBXStatsDTRow.MailboxGUID = $MailboxStats.MailboxGuid.ToString()
$MailboxStatistics.Rows.Add($NewMBXStatsDTRow)
$StopWatch.Stop()
$ElapsedTime = $StopWatch.Elapsed
Write-Host "The script took" $ElapsedTime.Hours "hours," $ElapsedTime.Minutes "minutes, and" $ElapsedTime.Seconds `
"seconds to run."
Here are the results in speed:
The script took 0 hours, 3 minutes, and 13 seconds to run.
So yeah... ~3 minutes versus ~1 hour, I would say that's an improvement.
Now I will go back to my script and as I process each mailbox I will pull it's statistics information out of the DataTable using its GUID with:
If ($MailboxStats = $MailboxStatistics.Rows.Find($Mailbox.MailboxGUID)) {
# Insert mailbox statistics processing here using the $MailboxStats variable with "." extensions.
} Else {
# Mailbox statistics weren't found so go grab them individually as a backup mechanism for scenarios when a user's mailbox got moved out of the DAG to a non-DAG database for whatever reason.
It's a little silly that I have to extract the information out of each DAG server and put it in an in-memory table just to speed this process up, but clearly there is overhead with the Get-MailboxStatistics cmdlet and grabbing more mailboxes at once helps
negate this issue.
I'm going to mark my own response as an answer because I don't think anyone else is going to come up with something better than what I put together. -
PHP script calling another but staying on same page
Hi,
Im thinking of writing an additional PHP page, that has a link to another PHP page, to do an insert. On the current PHP page, I have a counter which I would want incrementing after the 2nd PHP script is called, but don't think its possible?
I'm saying this as I will need an anchor to another script which when called, will load another PHP script - which will do the insert, but take me away from the current page.
So basically, I want to stay on the first PHP script showing a counter, click to call another PHP script, but all the user will see is a counter increment.
Here is what I have thought will not work:
<code>
echo "<br><span class=\"style1\"><a href=\"./../Test/count.php\"><img src=\"./Up.JPG\"></a>";
</code>
Thanks in advance...Hi,
got a bit further now in that i'm calling the php script through Ajax successfully, but, got the issue where i am getting the same value sent to the script (dataString):
source script:
<script type="text/javascript" >
$(function()
$(".submit").click(function()
var likeid = $("#likeid").val();
var dataString = 'likeid='+ likeid ;
var locurl = "./../Test/it.php?randval="+Math.random();
$.ajax({
type: "POST",
url: locurl,
data: dataString,
success: function()
$('.success').fadeIn(200).show();
$('.error').fadeOut(200).hide();
return false;
</script>
target script (it.php)
<?php if(!$_SESSION) { session_start(); } ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
</head>
<body>
<?php
$_SESSION['name']=session_id();
$sess=session_id();
$likeid=$_POST['likeid']; <----------------------always the same value
if($_POST)
$result2 = mysql_query("INSERT INTO Test (value, sess) VALUES ('$likeid', '$sess')")
or die(mysql_error());
?>
</body>
</html>
what i get is the same value for $likeid on every call from the source script. In the source script i have:
<form method="post" name="form1">
<input type="hidden" name="likeid" id="likeid" value="CAR79668"/>
<a href="#"><img src="./Up.JPG" border="0" class="submit" onclick="change11('CAR79668');"></a>
<b id="CAR79668" value="2">2</b> </form> </span>
<form method="post" name="form2">
<input type="hidden" name="likeid" id="likeid" value="CAR79669"/>
<a href="#"><img src="./Up.JPG" border="0" class="submit" onclick="change11('CAR79669');"></a>
<b id="CAR79669" value="2">2</b> </form> </span>
Why does the same value of CAR79668 get passed to the target script on every call?
Thanks. -
Hi everyone,
I've got a Flex application that works wonderfully when I test it on my machine locally. It uploads files and send variables to a PHP script (that inserts them into a DB) with no errors when I run it locally. As soon as I put it online, the upload continues to work but something between my Flex application and the PHP script fails because no data is committed to the DB. I know the PHP script works fine - not only does it work when I run the Flex application locally but when I go directly to the PHP file online, a new empty line is added to the DB.
I initially thought that this was a cross domain issue so I added the following to the root of my hosted account:
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*.MYURL"/>
<allow-http-request-headers-from domain="*.MYURL" headers="*" secure="false"/>
</cross-domain-policy>
I based this off of what I found online which seems to have done nothing for me. I'd also be happy to provide an error message but I don't get one when I debug.
Any thoughts would be greatly appreciated.Use a network monitor to see if the Flex app is truly requesting the right URL.
-Alex -
Template with php script, white space around background, locking layers
two questions for 2 sites:
1.) first site http://www.beckervanhoveln.com
I can't get my background to line up correctly; there is a giant white border around the whole thing. With the amount of extra space around the background on all sides, I think it may be an issue with the illustrator file I am importing, but I can't see any way to fix it there, either. All the margins that I can find to change relating to that background are set to 0. Any ideas on what could be causing this? The image in Illustrator is 14" wide, so it's plenty wide enough to cover the whole page.
2.) site http://sai.theclothesgallery.com
I inserted php scripts into a page (in the editable paragraph region) and it is messing up the alignment of the page. Compare what you get on the home page with what you get when you click the "client login" button. Also, wondering where the extra body area came from on page http://sai.theclothesgallery.com/protected_downloads_zdr/validuser.php.
On both sites I am using wrapper and body tags, as directed in the tutorial by Nate (great one, thanks!). On my old site, http://www.theclothesgallery.com, everything works fine, but on the new ones I am just out of my mind. I've spent 10 hours over the last 2 days doing research and trying to manipulate code, to no avail. Thanks to anyone who can help.
Finally, is there a way to lock a layer inside or on top of another layer. for example, the layer the body text is in on site http://sai.theclothesgallery.com is on top of the layer that holds the page's images (which is an imported illustrator file with slices). Is there a way to lock that layer to the first one so it doesn't move if I make changes?Kelly,
1. The image itself has a white border. You will need to crop that image
in an image editor such as Photoshop.
2. Looking at the source of the page you have two sections and
two opening toags but only one closingtag. The PHP
script is probably creating the additional sections, but without seeing
the script it is impossible to say for certain.
2a. You probably have a space or blank line before the opening -
Calling stored procedure from php script.
I have the following stored procedure in Oracle 8:
CREATE OR REPLACE procedure kunde_create
(iname1 in varchar2,
iname2 in varchar2,
iname3 in varchar2,
ianrede in number,
istrasse in varchar2,
iland varchar2,
iplz in varchar2,
iort in varchar2,
iortsteil in varchar2,
itelefon in varchar2,
iemail in varchar2,
itelefax in varchar2,
imobil in varchar2,
ianrufer in varchar2,
izusinfo in varchar2,
izusatz2 in varchar2,
okdnr out varchar2)
is
vkndnr number;
vadrnr number;
vkdnr varchar2(15);
ikugru constant number:=4;
minkdnr constant varchar2(15):='44000000';
maxkdnr constant varchar2(15):='50000000';
begin
..... SOME CODE ....
okdnr:='something_to_output';
commit;
end kunde_create;
I am trying to call this SP from a php script, in this way:
$connection = ora_logon("username@db", "password");
$cursor = ora_open($connection);
ora_commitoff($connection);
$cu=ora_parse($cursor, "begin KW.kunde_create ( :Sta_nameD, :Sta_name2D, :Sta_kugruD, :ianredeD, :Sta_straD, :Sta_landD, :Sta_plzD, :Sta_ortD, :Sta_ortsteilD, :Sta_telD, :Sta_mailD, :Sta_faxD, :Sta_tel2D, :Sta_anruD, :Sta_zusD, :Sta_zus2D ,:okdnr); end;");
ora_bind($cursor, ":Sta_nameD", $Sta_nameD, 32, 1);
ora_bind($cursor, ":Sta_name2D", $Sta_name2D, 32, 1);
ora_bind($cursor, ":ianredeD", $ianredeD, 32, 1);
ora_bind($cursor, ":Sta_straD", $Sta_straD, 32, 1);
ora_bind($cursor, ":Sta_landD", $Sta_landD, 32, 1);
ora_bind($cursor, ":Sta_plzD", $Sta_plzD, 32, 1);
ora_bind($cursor, ":Sta_ortD", $Sta_ortD, 32, 1);
ora_bind($cursor, ":Sta_ortsteilD", $Sta_ortsteilD, 32, 1);
ora_bind($cursor, ":Sta_telD", $Sta_telD, 32, 1);
ora_bind($cursor, ":Sta_mailD", $Sta_mailD, 32, 1);
ora_bind($cursor, ":Sta_faxD", $Sta_faxD, 32, 1);
ora_bind($cursor, ":Sta_tel2D", $Sta_tel2D, 32, 1);
ora_bind($cursor, ":Sta_anruD", $Sta_anruD, 32, 1);
ora_bind($cursor, ":Sta_zusD", $Sta_zusD, 32, 1);
ora_bind($cursor, ":Sta_zus2D", $Sta_zus2D, 32, 1);
ora_bind($cursor, ":okdnr", $okdnr, 32, 2);
ora_exec($cursor); //Line 93
This code brings me back this error:
Warning: Can't find variable for parameter in /www/vaillant/htdocs/www_tisweb/html/php/testdb/connect.php on line 93
I tried nearlly everything, but it doesnt work :(
Can anybody help me please.
Thanx in advance,
Ahmed AdailehI had to make a few modifications to get your example to work. The
biggest change was to the ora_bind syntax. I also found I had to
define a variable to hold the OUT value before doing the ora_exec.
Otherwise I got the error you saw. I'm not sure why defining it first
is necessary. I didn't dig deeply into PHP's oracle.c code.
My final script is below. It displays "okdnr is something_to_output".
I tested using PHP 4.3.3 against Oracle 9.2.
The best general suggestion I can make is to use PHP's oci8 driver
unless you need to be compatible with existing PHP code. There is an
example of using OUT binds in oci8 to call a stored procedure at
PHP and serveroutput
-- CJ
<?php
// Changed connection details to suit my environment
$connection = ora_logon("scott@MYDB", "tiger");
$cursor = ora_open($connection);
ora_commitoff($connection);
// Changed schema to SCOTT to match who I'd created the procedure as
$cu=ora_parse($cursor, "begin SCOTT.kunde_create ( :Sta_nameD, :Sta_name2D, :Sta_kugruD, :ianredeD, :Sta_straD, :Sta_landD, :Sta_plzD, :Sta_ortD, :Sta_ortsteilD, :Sta_telD, :Sta_mailD, :Sta_faxD, :Sta_tel2D, :Sta_anruD, :Sta_zusD, :Sta_zus2D ,:okdnr); end;");
// Allocated the IN parameter variables
$Sta_nameD = 'a';
$Sta_name2D = 'a';
$ianredeD = 1;
$Sta_straD = 'a';
$Sta_landD = 'a';
$Sta_plzD = 'a';
$Sta_ortD = 'a';
$Sta_ortsteilD = 'a';
$Sta_telD = 'a';
$Sta_mailD = 'a';
$Sta_faxD = 'a';
$Sta_tel2D = 'a';
$Sta_anruD = 'a';
$Sta_zusD = 'a';
$Sta_zus2D = 'a';
$Sta_kugruD = 'a';
// Changed ora_bind syntax to match
// http://www.php.net/manual/en/function.ora-bind.php
ora_bind($cursor, "Sta_nameD", ":Sta_nameD", 32, 1);
ora_bind($cursor, "Sta_name2D", ":Sta_name2D", 32, 1);
// Change ianredeD type to 2 to match procedure definition
ora_bind($cursor, "ianredeD", ":ianredeD", 32, 2);
ora_bind($cursor, "Sta_straD", ":Sta_straD", 32, 1);
ora_bind($cursor, "Sta_landD", ":Sta_landD", 32, 1);
ora_bind($cursor, "Sta_plzD", ":Sta_plzD", 32, 1);
ora_bind($cursor, "Sta_ortD", ":Sta_ortD", 32, 1);
ora_bind($cursor, "Sta_ortsteilD", ":Sta_ortsteilD", 32, 1);
ora_bind($cursor, "Sta_telD", ":Sta_telD", 32, 1);
ora_bind($cursor, "Sta_mailD", ":Sta_mailD", 32, 1);
ora_bind($cursor, "Sta_faxD", ":Sta_faxD", 32, 1);
ora_bind($cursor, "Sta_tel2D", ":Sta_tel2D", 32, 1);
ora_bind($cursor, "Sta_anruD", ":Sta_anruD", 32, 1);
ora_bind($cursor, "Sta_zusD", ":Sta_zusD", 32, 1);
ora_bind($cursor, "Sta_zus2D", ":Sta_zus2D", 32, 1);
// Changed okdnr type to 1 to match procedure definition
ora_bind($cursor, "okdnr", ":okdnr", 32, 1);
// Bound missing parameter
ora_bind($cursor, "Sta_kugruD", ":Sta_kugruD", 32, 1);
// Preallocated the output variable - I'm not sure why this is
// necessary nor what size is needed.
// When this line is commented out I get:
// Warning: Can't find variable for parameter in test01.php on line XX
$okdnr = "a";
ora_exec($cursor);
print "okdnr is $okdnr";
?> -
PHP script...where do I put my variables???
I'm working on a PHP script and I've got the fill in parts working but just cannot get my head around the drop down menu and radio buttons. I tried typing in the drop down menu pieces in the "$body" part of it but then all it did was send me everything. If the sender only wants one thing from the drop down menu, I only want to see what the customer wanted. Not what is in all the menu. From email to phone seems to work good but I guessed at the pull down "service menu" and also the Name through Comments works in the body portion as well but those pull down and radio parts are not sending. I don't even know what an EOD is and what to type in there or the results part as well. Please help!!
<?php
/* Email Variables */
$emailSubject = 'contactformprocess.php';
$webMaster = '[email protected]';
/* Data Variables */
$email = $_POST['email'];
$name = $_POST['name'];
$comments = $_POST['comments'];
$phone = $_POST['phone'];
$service = $_POST['Web Design'];
$budget = $_POST['RadioGroup1_0'];
$body = <<<EOD
<br><hr><br>
Name: $name <br>
Email: $email <br>
Phone: $phone <br>
Comments: $comments <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body,
$headers);
/* Results rendered as HTML */
$theResults = <<<EOD
<html>
<head>
<title>sent message</title>
<meta http-equiv="refresh" content="2;URL=http://thegoldenspindle.com/Contact.html">
<style type="text/css">Ok, here's the full script: and the contact page is http://thegoldenspindle.com/Contact.html The red is what I added that makes the whole script not send or work. I take them out and the script works again.
<?php
/* Email Variables */
$emailSubject = 'contactformprocess.php';
$webMaster = '[email protected]';
/* Data Variables */
$email = $_POST['email'];
$name = $_POST['name'];
$comments = $_POST['comments'];
$phone = $_POST['phone'];
$service = $_POST['service'];
$budget = $_POST['budget'];
$body = <<<EOD
<br><hr><br>
Name: $name <br>
Email: $email <br>
Phone: $phone <br>
Service: $service <br />
Budget: $budget <br />
Comments: $comments <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body,
$headers);
/* Results rendered as HTML */
$theResults = <<<EOD
<html>
<head>
<title>sent message</title>
<meta http-equiv="refresh" content="2;URL=http://thegoldenspindle.com/Contact.html">
<style type="text/css">
<!--
body {
background-color: #000000;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 20px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #fec001;
text-decoration: none;
padding-top: 200px;
margin-left: 150px;
width: 800px;
-->
</style>
</head>
<div align="center">Thank you for your email. You will be contacted a soon as possible!</div>
</div>
</body>
</html>
EOD;
echo "$theResults";
?>
OK, here is my Contact Page script as well if this helps.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Contact The Golden Spindle</title>
<style type="text/css">
<!--
body {
background-color: #000;
background-image: url(Background-BLACK.jpg);
background-repeat: repeat;
margin-left: 0%;
margin-right: 0%;
margin-top: 0%;
margin-bottom: 0%;
body,td,th {
font-size: x-small;
color: #FFF;
a:link {
color: #E8E8E8;
margin: 0px;
text-decoration: none;
a:visited {
text-decoration: none;
color: #E8E8E8;
a:hover {
color: #9DF99B;
cursor: auto;
filter: Invert;
text-decoration: none;
a:active {
text-decoration: none;
color: #930;
.style32 {
font-size: x-large;
text-transform: none;
.style33 {
font-size: large;
font-family: Arial, Helvetica, sans-serif;
.style35 {
font-family: Arial, Helvetica, sans-serif;
color: #FFF;
.style36 {font-size: small; font-family: Arial, Helvetica, sans-serif; }
.style39 {font-size: small}
.style47 {font-size: x-large;
color: #c7a317;
.style48 {font-size: large;
font-family: Arial, Helvetica, sans-serif;
color: #BBBBBB;
.style49 { color: #c7a317;
font-size: small;
.style153 {
font-size: 14px;
color: #F2E69A;
font-family: Arial, Helvetica, sans-serif;
.style154 {
font-size: 15px;
color: #F2E69A;
font-family: Arial, Helvetica, sans-serif;
.style157 {color: #726D49}
.style158 {font-size: 12px}
.style159 {font-family: Arial, Helvetica, sans-serif; color: #F2E69A;}
.style40 {color: #BBBBBB}
.style56 {color: #F2E69A}
.style65 {font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
font-size: 14px;
font-style: italic;
#MenuBar1 li .goldensettings.MenuBarItemSubmenu .goldensettings {
font-size: 16px;
#MenuBar1 li .MenuBarSubmenuVisible li {
font-size: 0px;
#MenuBar1 li .MenuBarSubmenuVisible li {
font-size: 16px;
color: #3CC;
#y {
font-size: 0px;
#box {
font-size: 2px;
#Box2 {
font-size: 2px;
#box3 {
font-size: 2px;
#box4 {
font-size: 2px;
#box5 {
font-size: 2px;
#box6 {
font-size: 2px;
#box7 {
font-size: 2px;
#box8 {
font-size: 2px;
#box9 {
font-size: 2px;
#box10 {
font-size: 2px;
#box11 {
font-size: 1.2px;
#box12 {
font-size: 1.2px;
#box14 {
font-size: 1.2px;
#box16 {
font-size: 1.2px;
#box17 {
font-size: 1.2px;
#box18 {
font-size: 1.2px;
#box20 {
font-size: 1.2px;
#box21 {
font-size: 1.2px;
#box22 {
font-size: 1.2px;
#bx1 {
font-size: 5x-small;
#x {
font-size: 1px;
#x1 {
font-size: 1px;
#bx3 {
font-size: 1px;
#bx6 {
font-size: 1px;
#bx6 {
font-size: 1px;
#bx7 {
font-size: 1px;
#bx8 {
font-size: 1px;
#bx9 {
font-size: 1px;
#MenuBar1 li .MenuBarSubmenuVisible li a {
font-family: Arial, Helvetica, sans-serif;
#MenuBar1 li .MenuBarSubmenuVisible li a {
font-family: Arial, Helvetica, sans-serif;
#MenuBar1 li a {
font-family: Arial, Helvetica, sans-serif;
-->
</style>
<style type="text/css">
<!--
.style351 {font-family: Arial, Helvetica, sans-serif}
-->
</style>
<style type="text/css">
<!--
.style156 {font-size: 15px;
color: #F2E69A;
font-family: Arial, Helvetica, sans-serif;
.none {
color: #CCC;
-->
</style>
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
</head>
<body link="#33CC66" alink="#FFFFFF">
<blockquote>
<blockquote>
<table width="547" border="0" align="center">
<tr>
<th width="541" height="93" bordercolor="#000000" scope="col"><div align="left" class="style32">
<table width="541" height="68" border="0" align="center" cellspacing="0" bordercolor="0">
<tr>
<th width="531" height="66" scope="col"><img src="Golden-Spindle-LOGO.png" width="512" height="218" /></th>
</tr>
</table>
</div></th>
</tr>
</table>
</blockquote>
</blockquote>
<table width="1073" height="40" border="1" align="center" cellspacing="0" bordercolor="#1F252D" background="Blue-Bar-Flame008.png">
<tr>
<th width="1067" height="36" align="center" valign="middle" scope="col"><table width="912" border="0" align="center">
<tr>
<td width="906" align="center" scope="col"><ul id="MenuBar1" class="MenuBarHorizontal">
<li>
<div align="center"><a href="index.html">HOME</a></div>
</li>
<li><a href="#" class="MenuBarItemSubmenu">SERVICES</a>
<ul>
<li><a href="#" class="MenuBarItemSubmenu">3D Texturing</a>
<ul>
<li><a href="3D Texturing.html">Stills</a></li>
<li><a href="Electroplating.html">Electroplating</a></li>
<li><a href="Hologram.html">Holograms</a></li>
</ul>
</li>
<li><a href="3D Composite.html">3D Composite</a></li>
<li><a href="#" class="MenuBarItemSubmenu">Water</a>
<ul>
<li><a href="Ocean.html">Ocean</a></li>
<li><a href="Fluid Reactions.html">Fluid Reactions</a></li>
</ul>
</li>
<li><a href="#" class="MenuBarItemSubmenu">2D Work</a>
<ul>
<li><a href="Composites.html">Composite</a></li>
<li><a href="Face Morphing.html">Face Replacement</a></li>
<li><a href="Photo Restore.html">Photo Restoring</a></li>
<li><a href="Touchups.html">Touch Ups</a></li>
<li><a href="2D Animation.html">2D Animation</a></li>
</ul>
</li>
<li><a href="#" class="MenuBarItemSubmenu">Visual Effects</a>
<ul>
<li><a href="Chroma Key.html">Chroma Key</a></li>
</ul>
</li>
<li><a href="Video Editing.html" class="goldensettings">Video Editing</a></li>
<li><a href="#" class="MenuBarItemSubmenu">Cloth & Materials</a>
<ul>
<li><a href="Flag Blowing.html">Flag</a></li>
</ul>
</li>
<li><a href="#" class="MenuBarItemSubmenu">Ad Design</a>
<ul>
<li><a href="Brochures.html">Brochures</a></li>
<li><a href="Magazine.html">Magazine</a></li>
<li><a href="Box Design.html">Box & Print</a></li>
<li><a href="Infomercial.html">Infomercials</a></li>
</ul>
</li>
<li><a href="Logos.html">Company Logos</a></li>
<li><a href="#" class="MenuBarItemSubmenu">Planets & Space</a>
<ul>
<li><a href="Earth.html">Earth</a></li>
<li><a href="Planets & Space.html">Moon</a></li>
</ul>
</li>
<li><a href="#" class="MenuBarItemSubmenu">Camera Techniques</a>
<ul>
<li><a href="Nasa Cam.html">NASA cam</a></li>
<li><a href="Hand Cam earth.html">Hand Cam</a></li>
</ul>
</li>
<li><a href="Graphics & Webdesign.html">Web Design</a></li>
<li><a href="Business Cards.html">Business Cards</a></li>
</ul>
</li>
<li><a href="REEL.html">DEMO REEL</a></li>
<li><a href="Graphics & Webdesign.html">WEB DESIGN</a></li>
<li><a href="Animation.html">ANIMATION</a></li>
<li><a href="Contact.html">CONTACT ME</a></li>
</ul></td>
</tr>
</table></th>
</tr>
</table>
<br />
<table width="1073" border="0" align="center" cellspacing="0">
<tr>
<td align="right"><img src="Labels-Contact-video.png" alt="" width="497" height="19" /></td>
</tr>
</table>
<br />
<br />
<form id="form2" name="form2" method="post" action="contactformprocess.php">
<table width="1166" height="167" border="0" align="center" cellpadding="4" cellspacing="0">
<tr>
<td width="211" align="right"><label for="name">Name:</label></td>
<td width="933"><input name="name" type="text" id="name" size="35" maxlength="80" /></td>
</tr>
<tr>
<td align="right"><label for="email2">Email:</label></td>
<td><input name="email" type="text" id="email2" size="35" maxlength="90" /></td>
</tr>
<tr>
<td height="25" align="right"><label for="phone">Phone:</label></td>
<td><input name="phone" type="text" id="phone" size="35" maxlength="12" /></td>
</tr>
<tr>
<td height="22" align="right"><label for="Service Needed:">Service Needed:</label></td>
<td><input name="Service Needed:" type="text" id="Service Needed:" size="35" maxlength="35" /></td>
</tr>
<tr>
<td height="4" align="right">Budget:</td>
<td><input name="Budget:" type="text" id="Budget:" size="35" maxlength="50" /></td>
</tr>
<tr>
<td height="5" align="right"><label for="comments">Comments:</label></td>
<td><textarea name="comments" id="comments" cols="33" rows="5"></textarea></td>
</tr>
<tr>
<td height="13" align="right"><label for="clear"></label>
<input type="reset" name="clear" id="clear" value="Reset Form" /></td>
<td align="left"><label for="submit"></label>
<input type="submit" name="submit" id="submit" value="Submit" /></td>
</tr>
<tr>
<td> </td>
<td align="right"> </td>
</tr>
</table>
</form>
<p><br />
</p>
<table width="391" height="20" border="0" align="center" bordercolor="#000000">
<tr>
<th width="381" scope="col"><div align="left" class="style351">
<div align="center"><a href="About me.html">About Me</a><a href="REEL.html"></a> | <a href="Graphics & Webdesign.html">Graphic & Web Design</a> | <a href="Animation.html">Animation</a> | <a href="Video Editing.html">Video Editing</a> | <a href="Resume Video.pdf">Video Resume</a></div>
</div></th>
</tr>
</table>
<table width="422" height="36" border="0" align="center" bordercolor="#000000">
<tr>
<th width="412" height="30" scope="col"><div align="left" class="style351">
<div align="center"><span class="style40"><a href="Contact.html">Contact</a> | Leavenworth, KS | [email protected]<br />
</span></div>
<span class="style40">
<label></label>
</span>
<div align="center" class="style40">© 2009 The Golden Spindle, LLC. All Rights Reserved. </div>
</div></th>
</tr>
</table>
<p> </p>
<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>
</body>
</html> -
[SOLVED] PHP script returning a 255 errorcode
Hello,
I have a rather strange problem at hand currently. I am using the stock binary PHP supplied in the repositories with sqlite3, pdo ,pdo-sqlite, and soap modules enabled. Whenever I try to run a PHP script, however, no output is returned to STDOUT (although there should be) and when I execute it in ScITE, I get an exit code of 255. The exact same script works on a FreeBSD server that I have access to and did work fine on SUSE linux, and also on this machine until two days ago. It is intermittent, I briefly fixed the issue by rewriting the ?> brackets and saving the file, then by converting the EOLs from CRLF to LF using dos2unix, however both times the script reverted. There are other PHP scripts that work fine, and even this one used to work OK. I also want to mention that I had edited the file using DEV-PHP 2.2 for Windows but while the file was on the BSD server, and on Arch and SUSE. Thank you all!
Last edited by ibnpaul (2007-11-07 05:04:33)> ~/Development/1&1/Abuse/lgrp_beta $ ./lgrp.php
> ~/Development/1&1/Abuse/lgrp_beta $ php -l lgrp.php
Errors parsing lgrp.php
> ~/Development/1&1/Abuse/lgrp_beta $ ./lgrp
LogGrep v0.3 -- Help
Usage: lgrp [-option [parameter]]...
This above code shows that calling ./lgrp.php does not work, we hit errors when trying to check syntax, and a copy of the script, lgrp, runs fine, as can be seet by the output. Does anyone have any ideas? Thanks again! -
Connect to oracle database with php script
Hello!
How can I connect to an Oracle database with a PHP script? I read about it at www.php.net:
"Oracle 8 functions; These functions allow you to access Oracle8 and Oracle7 databases. It uses the Oracle8 Call-Interface (OCI8). You will need the Oracle8 client libraries to use this extension."
Where can I get these libraries from?
Who knows more about the issue?
Thanks a lot for your help!
Martin
nullHello
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by mheibel([email protected]):
Hello!
How can I connect to an Oracle database with a PHP script? I read about it at www.php.net:
"Oracle 8 functions; These functions allow you to access Oracle8 and Oracle7 databases. It uses the Oracle8 Call-Interface (OCI8). You will need the Oracle8 client libraries to use this extension."
Where can I get these libraries from?
Who knows more about the issue?
Thanks a lot for your help!
Martin<HR></BLOCKQUOTE>
Install and put working a sqlnet working client (install the Oracle Client option of the Oracle Database CD ROM). Than compile php with the --oci option. Than try the samples in php.net (oci function in the help).
These are the steps... Put everything working is a little more complicated...
FS
null -
PHP script won't run in the background
Hi all
Hope someone can help me with a weird issue I have...
I am trying to run a php CLI script in the background and it just won't run - it has a status of Stopped SIGTOU (Trying to write output) - Here are the details
OS
Mac OS X Lion 10.7.2
PHP
PHP 5.3.6 with Suhosin-Patch (cli) (built: Sep 8 2011 19:34:00)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
I created a basic script test.php
<?php echo 'Hello world'.PHP_EOL; ?>
Here are the results of various tests:-
Test 1) php -f test.php (Hello world gets displayed)
Test 2) php -f test.php >test.log 2>&1 (Hello world gets put into test.log)
Test 3) php -f test.php >test.log 2>&1 & --- I get [1]+ Stopped(SIGTTOU) php -f test.php > test.log 2>&1 -- and the job just sits there doing nothing nothing gets logged however lsof shows the log file is open
It has to be something to do with Apple's php build because a similar bash shell script gets executed no problems in the background...
This has me stumped ... any ideas? What can I do to find out what is going on ...?
TIA
RichJust realized your trying to load the php files by using the File->Open menu item in the Browser. That won;t work.
You have to load the php file by placing it in the Sites folder and entering http://localhost/file.php
(or if you have user Sites enabled http://localhost/~user/file.php)
The reason it is grayed out is that the browser doesn't run (or know of) php files. The web server runs those (via php) and the output of the file goes to the web browser.
This page How to enable Web Sharing in OS X Mountain Lion does a pretty good job of explaining it. (as does the user tip I lonked to before) -
Installing an AIR application generated from a PHP script using a badge
I have written a PHP script to return a file with the Content-Type header set to application/vnd.adobe.air-application-installer-package+zip to simulate a response that looks like an AIR file. The Content-Length and Content-Disposition headers are also being sent. I am then writing the bytes of the file to the output. This appears to work in the browser, as the file downloads and can be installed. However, when the badge tries to use the URL, I get a Stream 2032 error. Does the AIR badge not allow a URL without an .air extension, even if the response is in the correct format for an AIR file? If this is allowed, are there other headers that need to be set for this to work?
Thanks,
PaulI figured it out. The AIR installer was stripping out my query parameters. I made the URL use slashes for the parameters with a rewrite instead of ? and & it worked.
Maybe you are looking for
-
Hi My mail app have stopped to play the "got mail" sound !?! Everything else works. Dvd, internet, itunes and so on. It´s just mail who does not play any sound anymore ? when I got to preferences and choose my sound it plays but not when I get a mail
-
Do objects that are on stage, but off screen also affect memory upon playback?
Hi, In my flash scene, I want to put several items off screen (to make things easier) which are going to rush through the scene (they are very big in size) but I worry that they might slow down the movie as it's playing. But if I have things off the
-
Hello, Is it possible to create a file event which "files" field can use a parameter as value ? My point is that I would like to create a script, with a directory path parameter, that is launched every time that a file comes to the directory path par
-
Which Switch and Router to choose?
I am interested in purchasing a Cisco Switch and Router, or possible a Cisco Switch Router. However, I am not sure of what model to go with. Currently, we have a network with about 200 Workstations and 30 Servers for our Corporation Infrastructure. A
-
HT5192 how can i get this software update(iOS 5.1)
please tell me