Using PHP scripts to authenticate - "unique_name_from_itunes" ???
We are attempting to use the PHP scripts (version 1.1) designed by Aaron Axelsen of University of Wisconsin - Whitewater (http://omega1.uww.edu/itunesu) to help facilitate authentication to iTunes U. We're bouncing credentials off our AD via PHP and LDAP, and once the user is authenticated, we're attempting to authorize them with the appropriate level of permission to iTunes U. To start off we're keeping it really simple. We have three levels: admin, instructor, and student. The administrative login works, but when we attempt to authorize a student or instructor, it appears to work but then brings the student to a blank iTune Store page. It does not recognize the identity string. Here's the debug output:
Analysis
+The destination string is valid and the corresponding destination item was found.+
+The identity string is valid and provides the following information:+
+Display Name Training Test01+
+Email Address [email protected]+
+Username testt+
+User Identifier userid+
+The credential string is valid but contains no known credentials.+
+The credential string contains the following credential which is not used within iTunes U:+
+1. Student@urn:mace:itunesu.com:sites:centenarycollege.edu:uniquename_fromitunes+
At the end of the Student credential string there it says "uniquename_fromitunes" - what is suppose to be there and where/how do I obtain that data string?
I have emailed the developer of these scripts and am awaiting his reply, but was hoping someone here might be able to help. Any help would be extremely appreciated. I'm befuddled at the moment and suspect the answer is a simple one.
Regards,
John
It's been a while since I mucked around with credentials, and I'm doing this via Perl rather than PHP, but the principle is the same. To give students site-level browse capability within iTunes U, I've created a credential called "Student@urn:mace:lafayette.edu" and given it download rights within iTunes. When I connect a student to iTunes U, they're given that credential by default. I have similar credentials for Faculty and College (college being everyone who isn't a student or faculty member).
If memory serves, iTunes U should automatically assign someone the "authenticated" role when they connect via your connection script, so if you setup content to be downloadable by "authenticated", then that should allow your students (and anyone else who properly authenticates) into the site. That allows for a quick and dirty separation of public vs. college content without mucking around with specific faculty/student/staff roles. If you want to go further, and restrict access to specific sections our courses, then you'll definitely want those sorts of focused roles, and make use of the ${IDENTIFIER} technique described in the access control documentation.
Ken Newquist
Lafayette College
Similar Messages
-
I was wondering if it was possible to put a php script on part of a flash page. For example, when u click a button, a box appears that has the most recent posts from your forum. I have the php scipt and everything, i just need to know how i can get it to function like that. Thanks
That is beyond the scope of Flash Catalyst. You would be able to add that functionality to a Flash Catalyst project from within Flash Builder. You would need to add some ActionScript code to the project to make it work. But you could do the visual design in Flash Catalyst first before working with the code.
Take a look at the new Data Wizard in Flash Builder to assist in the connections to the PHP script. There are tutorials on tv.adobe.com on this.
Chris -
DW CS5, Sending contact form results to email with page redirection using php script
I am currently building a site from scratch with Dreamweaver, with the intent of replacing my current website layout that was designed using Intuit's website builder. My dreamweaver site is not online, but i have setup a local test server on my computer, using XAMPP, and i have an apache server with a MySQL database and a mercury mailserver running. I mention that in case it makes a difference in your answers. If necessary, I can include those settings, but that may be asking too much.
I have an html contact form for users to schedule service appointments. I need the resulting actioned php file to do the following after submit is clicked: verify certain fields have been entered; prevent spammers or verify human visitors; send the form results to a (hidden from public view of any kind) email address; redirect user to a confirmation page, or an error page.
I found the following code but being less than a newbie im not sure what needs to be changed, or if its even the right script i should be using:
5 <?php
6 $email = $_POST['email'];
7 $mailto = '[email protected]';
8 $mailsubj = 'You Have a Service Request';
9 $url = '/MyLandingPage.html';
10 $req = '0';
11 $mailbody = "Results from form:\r\n";
12 $space = ' ';
13 $line = '
14 ';
15 foreach ($_POST as $key => $value)
16 {
17 if ($req == '1')
18 {
19 if ($value == '')
20 {echo "$key is empty";die;}
21 }
22 $j = strlen($key);
23 if ($j >= 20)
24 {echo "Name of form element $key cannot be longer than 20 characters";die;}
25 $j = 20 - $j;
26 for ($i = 1; $i <= $j; $i++)
27 {$space .= ' ';}
28 $value = str_replace('\r\n', "$line", $value);
29 $conc = "{$key}:$space{$value}$line";
30 $text .= $conc;
31 $space = ' ';
32 }
33 mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
34 echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
35 ?>
Can anyone please illuminate me on what I need?
Thank You in advanceTake a read here, this might enlighten you a little.
http://www.paulgdesigns.com/learncontactform.php
You are doing this with your local testing server, is it set up to email?
Gary -
Problem connecting oracle10g using php script
i have run following script to check how well configuration is done. I am getting error of
Fatal error: Call to undefined function OCILogon() in C:\Program Files\Apache Group\Apache2\htdocs\oci8test.php on line 2 .
i am new to php. I hv check php apache together. works well.
oracle10g works well.
where could be the problem. i entered username and password also.. pl help me to resolve this.
<?PHP
if ($conn=OCILogon("user@hr","1")) {
echo "<B>SUCCESS ! Connected to database<B>\n";
} else {
echo "<B>Failed :-( Could not connect to database<B>\n";
Ora_Logoff($conn);
phpinfo();
?>There are various installation guides on the web and in published Oracle-PHP books.
For example there are steps in the Underground PHP and Oracle Manual
-- cj -
PHP scripts are not working after deploying it on website
Hi,
I have recently deployed my flex application on a web hosting (000webhost.com) and now my application is getting launched properly. Visit (www.kpratik.webatu.com).
I have used PHP script to interact with database MySQL. Locally everything was working fine but when I have deployed it to internet my PHP scripts are not working and any database opeartion is not getting performed. I have already chaned to host, username password in the PHP file as given my service provider.
Please let me know if you have any input on this.
Reponse will be highly appreciated.
Regards,
PratikHello,
Ok let me explain you where exactly it is going wrong.
I am constructing SQL query in my ActionScript code and I am passing this query to my PHP script using HTTPService. Now when I am hardcoing the query in PHP script i found it is working perfectly which means my query is not getting passed to PHP script.
Please let me know what could be the reason.
I am using POST method for HTTPService.
Thanks,
Pratik -
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. -
Can you create a form not using a php script?
I need to create a contact us form on my website using DW and have researched how and understand the easiest way is using a php script. Unfortuntately, my webhost server does not support this and will charge me an arm and a leg in order to to do it. Is there another way to have a functioning contact form not using a php script?
Yes and no.
You could use a mailto link for your form action instead of a PHP script.
There are several problems with this method though. First, when you do that, you are at the mercy of the viewer's computer set-up. Mailto links use whatever email client is installed on the machine in order to send the message. Public computers (libraries, colleges, etc) almost never have an email client installed, so when a viewer on one of those machines clicks the link, nothing happens. Secondly, your email address is open for spam harvesters, so you may end up with enlargement and nigerian scam emails flooding your inbox.
Since your provider doesn't give you a way to do it the right way on your server, you may want to look into email form services online and see if they are less expensive than your current alternative. -
Uploading a file using a php script while running application with LCDS
Hi! I developping an application under Flex 2 / Java -
running on LCDS / JRun server.
I'm trying to add uploading capabilities. I'm using a php
script for the upload part.
First, I just try to put script on the app directory. Doesn't
work.
After that I set up an apache server from where I put a small
web site with my script. It's telling me that my file is
succesfully uploaded, but I can't find the file. The apache log
give me no error.
Someone can help me?Originally, I had problems w/ the file being placed in
C:/whatever.ext b/c I wasn't using relative paths.
This is the code I use:
$MAXIMUM_FILESIZE = 1024 * 1024 * 2; // 2MB
$newFileLoc = "./wherever/file.jpg"
if ($_FILES['Filedata']['size'] <= $MAXIMUM_FILESIZE) {
move_uploaded_file($_FILES['Filedata']['tmp_name'],
"./temporary/".$_FILES['Filedata']['name']);
rename( "./temporary/".$_FILES['Filedata']['name'],
$newFileLoc );
chmod( $newFileLoc, 0777 );
Modified from this article by Adobe:
http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Live Docs_Book_Parts&file=17_Networking_and_communications_173_6.html -
Calling Apex Application using a php script
Hi guys,how can i directly call my Apex Application using a php script.i have apex 2.1 intalled on my system.i created an application and i want my application users to connect directly to the applications login page.I mean somthing like this
(http://127.0.0.1:8080/apex/f?p=103)
and i want users to connect using somthing like this
(http://my system/index.php) or localhost/index.php?
i can run a script query and access my data stored on the database,but what i really want is to connect directly to the login page of my application,so that the staffs in HR can connect direstly to there HR application while those in Sales Will connect direcly to there applications page so it will look like this
http://my system/hr.php
http://mysystem/sales.phpOriginally, I had problems w/ the file being placed in
C:/whatever.ext b/c I wasn't using relative paths.
This is the code I use:
$MAXIMUM_FILESIZE = 1024 * 1024 * 2; // 2MB
$newFileLoc = "./wherever/file.jpg"
if ($_FILES['Filedata']['size'] <= $MAXIMUM_FILESIZE) {
move_uploaded_file($_FILES['Filedata']['tmp_name'],
"./temporary/".$_FILES['Filedata']['name']);
rename( "./temporary/".$_FILES['Filedata']['name'],
$newFileLoc );
chmod( $newFileLoc, 0777 );
Modified from this article by Adobe:
http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Live Docs_Book_Parts&file=17_Networking_and_communications_173_6.html -
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.
-
Sending string to php script using HttpConnection, OutputStream, POST
I am currently building an imode application using DoJa 2.5 standards and the problem I'm having is that when I send a string to a php script using a HttpConnection object and an OuputStream object via Http POST method, It does not seem to be sent at all. You'll probably understand a little better if you read the following code:
* main.java
* DATE : 2005/12/19 14:47
import com.nttdocomo.ui.IApplication;
import com.nttdocomo.ui.Display;
import com.nttdocomo.util.Phone;
import com.nttdocomo.io.HttpConnection;
import java.io.*;
import javax.microedition.io.*;
import com.nttdocomo.net.URLEncoder;
* main
* @TetraCON
public class main extends IApplication
// Declareer een object van de klasse Gebruiker
public Gebruiker gebruiker;
// Declareer een object van de mainpanel klasse
private MainPanel mainPanel;
public void start()
//Maak object van Gebruiker aan met het sim_nr van de simkaart
gebruiker = new Gebruiker(Phone.getProperty("terminal-id"));
/* Testing... *************/
System.out.println(gebruiker.getSim_nr());
// Declareer een nog niet ingestelde HttpConnection
HttpConnection con = null;
OutputStream out = null;
InputStream is = null;
try
// Stel de parameters van de HttpConnection in en krijg er een object van
//con = (HttpConnection)Connector.open( IApplication.getCurrentApp().getSourceURL() + "validate-terminal.php", Connector.READ_WRITE, true);
/* Testing.... ****************/
con = (HttpConnection)Connector.open( IApplication.getCurrentApp().getSourceURL() + "validate-terminal-test.php", Connector.READ_WRITE, true);
con.setRequestMethod(HttpConnection.POST);
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
// Declareer een OutputStream en link deze aan de HttpConnection
out = con.openOutputStream();
// Zet het te versturen sim_nr in de buffer van de OutputStream
out.write((URLEncoder.encode("sim_nr=" + gebruiker.getSim_nr())).getBytes());
// Sluit de OutputStream
out.close();
// Maak verbinding met de server en verstuur het sim_nr
con.connect();
// Declareer een InputStream en link deze aan de HttpConnection
is = con.openInputStream();
// Declareer een byte array van 20 bytes om de data in op te vangen
byte[] b = new byte[200];
// Roep de read methode van de InputStream aan om de data in de byte array te zetten
is.read(b);
// Sluit de InputStream
is.close();
// Sluit de verbinding
con.close();
// Geef de gebruikersnaam uit de byte array aan het attribuut van gebruiker of geef geen toegang
/* Testing..... **********************/
System.out.println(new String(b));
catch(Exception e)
System.out.println(e.toString());
try
if(out != null) out.close();
if(is != null) is.close();
if(con != null) con.close();
catch(Exception e2)
System.out.println("Exception: " + e2.toString());
// initialiseer het mainpanel
mainPanel = new MainPanel();
// Geef het mainPanel weer
Display.setCurrent(mainPanel);
}The data I'm trying to submit does not show up in the $_POST variable in PHP as it should.
Is there anybody out there who can tell me what I'm doing wrong?Hi Antoni, you can delete the 'mx:request' section and pass
the 'registrationModel' object into the send parameters.
Code should be:
<?xml version="1.0" encoding="iso-8859-1"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
public function submitForm():void {
formSender.cancel();
formSender.send(registrationModel);
//formSender.showBusyCursor = true;
Alert.show("Your request has been send successfully.", "Send
Report", Alert.OK , this);
//resetForm();
private function getResultOk(r:Number,event:Event):void{
if(!r){
Alert.show('Error sending data!!');
return;
Alert.show( String(this.formSender.lastResult) );
]]>
</mx:Script>
<mx:HTTPService id="formSender"
url="
http://www.yourdomain.com/mailer.php"
method="POST" showBusyCursor="true" useProxy="false"
result="getResultOk(1,event)"
fault="getResultOk(0,event)" >
</mx:HTTPService>
<mx:Model id="registrationModel">
<firstname>{firstname.text}</firstname>
<lastname>{lastname.text}</lastname>
<email>{email.text}</email>
<position>{position.text}</position>
</mx:Model>
<mx:Form width="100%" height="100%">
<mx:TextInput id="firstname" text="pepe"/>
<mx:TextInput id="lastname" text="lopez"/>
<mx:TextInput id="email" text="[email protected]"/>
<mx:TextInput id="position" text="director"/>
<mx:Button label="send" click="submitForm()"/>
</mx:Form>
</mx:Application>
And php...
<?
echo 'OK: Vars received:'.count($_POST)."\n";
foreach($_POST as $k=>$v){
echo $k.'='.$v."\n";
exit;
?> -
'''php script:'''
<?php
$page = $_GET['page'];
if ($page)
include ("inc/".$page.".php");
else
include ("inc/home.php");
?>
'''Action script 2.0 in flash:'''
on(release){
getURL("index.php?page=new");
}A good place to ask questions and advice about web development is at the mozillaZine Web Development/Standards Evangelism forum.<br />
The helpers at that forum are more knowledgeable about web development issues.
You need to register at the mozillaZine forum site in order to post at that forum.
See http://forums.mozillazine.org/viewforum.php?f=25 -
Help: Sending HTTPService request using POST to a php script
Hello all,
I need help in learning the proper method of communicating to php scripts from flex 3. I am very new to flex 3, php and web development. Thanks!
What I am trying to do is as follows:
1. User drags and drops a few items in a list control
2. user clicks a button to send these keywords to server php script
3. server will form a query based on the words sent and retrieve records and send them back
Here is what I have done so far:
1. When I send a request to server without any parameters, I amable to receive the request and query the database and send results in xml format
current issues I am facing:
1. I am gathering the list of entries in list control as follows:
<*** this function is callled when user decides to send request to server ***>private function startsearch():void {
var i:int;
var myAC:ArrayCollection = ArrayCollection(SelCtypes_id.dataProvider);
var nct:XML = new XML("<contenttypes></contenttypes>");
// add contenttype child now
for (i = 0; i<myAC.length; i++) {
nct.appendChild(XML(<contenttype>{myAC[i].toString()}</contenttype>));
var params:Object = new Object();
params.contenttypes = nct.toXMLString();
getsearchresults.send(params);
<*** my http service entry****>
<mx:HTTPService id="getsearchresults"
method="post"
url="http://localhost/search_xml.php"
result="handlesearchresultsXml(event)"
contentType="application/xml" />
This is what I see in flex debugger just when the request is sent out:
-> just before gersearchresults.send(params) call:
params.contenttypes = "<contenttypes>
<contenttype>AVI</contenttype>
<contenttype>SWF</contenttype>
</contenttypes>"
<*** within the HTTPrequest send function, I see th following in debugger ***>
message.contentType="application/xml"
message.body = paramsToSend shows "<contenttypes><contenttypes>
<contenttype>AVI</contenttype>
<contenttype>SWF</contenttype>
</contenttypes></contenttypes>"
This looks like my XML object is again formatted by an out <contenttypes> tag and the string is converted to be HTML safe (i.e. <, > notation).
It looks like I am not doing something right with my params formation to XML and HTTPservice is reformatting it to be some form of XML (I do not know XML well either :-)
My questions:
1. What am I doing wrong?
2. If there is a good example where I can send multiple parameters from flex client to php server and get data back where the request parameters will beof the form...
<query>
<type1>
<type1val>value1</type1val>
<type1val>value2</type1val>
</type1>
<type2>
<type2val>value3</type2val>
<type2val>value4</type2val>
</type2>
</query>
Thanks for your help!Hi, I'm having a problem with a similiar issue :/
I'm getting the error #1010 (A term is undefined and has no properties):
at flexGraph/httpResultHandlerUserInfo()
at flexGraph/__userInfoXML_result()
etc.
I removed some parts of the code so it's easier to read, if you can help me. I'm trying to populate a datagrid with info from a database, according to the alias I choose in the ComboBox. I get the error when I pick an alias from the ComboBox.
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.events.DropdownEvent;
[Bindable] private var usersInfo:ArrayCollection;
private function httpResultHandlerUserInfo(event:ResultEvent):void{
usersInfo = event.result.users.user;
private function chooseUserCB(event:DropdownEvent):void{
userInfoXML.send();
]]>
<mx:HTTPService id="userInfoXML" url="http://www.mysecondplace.org/flex/userInfo.php"
result="httpResultHandlerUserInfo(event)"
useProxy="false" method="POST">
<mx:request xmlns=""><alias>{usersAliasCB.selectedItem.alias}</alias></mx:request>
</mx:HTTPService>
<mx:ComboBox id="usersAliasCB"
x="10" y="10"
labelField="alias"
close="chooseUserCB(event)"/>
<mx:DataGrid id="testing"
x="10" y="100"
dataProvider="{usersInfo}"/>
Here's an example from the PHP file:
$query_user = "SELECT * FROM users WHERE alias='.$_POST["alias"].'";
Help me please -
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/ -
How use PHP to read image files from a folder and display them in Flex 3 tilelist.
Hello. I need help on displaying images from a folder dynamically using PHP and display it on FLEX 3 TileList. Im currently able to read the image files from the folder but i don't know how to display them in the TileList. This is my current code
PHP :
PHP Code:
<?php
//Open images directory
$imglist = '';
$dir = dir("C:\Documents and Settings\april09mpsip\My Documents\Flex Builder 3\PHPTEST\src\Assets\images");
//List files in images directory
while (($file = $dir->read()) !== false)
if (eregi("gif", $file) || eregi("jpg", $file) || eregi("png", $file))
echo "filename: " . $file . "\n";
$dir->close();
?>
FLEX 3 :
Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="pic.send();">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.FlexEvent;
import mx.rpc.events.FaultEvent;
import mx.events.ItemClickEvent;
import mx.rpc.events.ResultEvent;
public var image:Object;
private function resultHandler(event:ResultEvent):void
image = (event.result);
ta1.text = String(event.result);
private function faultHandler(event:FaultEvent):void
ta1.text = "Fault Response from HTTPService call:\n ";
]]>
</mx:Script>
<mx:TileList x="31" y="22" initialize="init();" dataProvider = "{image}" width="630" height="149"/>
<mx:String id="phpPicture">http://localhost/php/Picture.php</mx:String>
<mx:HTTPService id="pic" url="{phpPicture}" method="POST"
result="{resultHandler(event)}" fault="{faultHandler(event)}"/>
<mx:TextArea x="136" y="325" width="182" height="221" id="ta1" editable="false"/>
<mx:Label x="136" y="297" text="List of files in the folder" width="182" height="20" fontWeight="bold" fontSize="13"/>
</mx:Application>
Thanks. Need help as soon as possbile. URGENT.i have made some changes, in the php part too, and following is the resulting code( i tried it, and found that it works.):
PHP Code:
<?php
echo '<?xml version="1.0" encoding="utf-8"?>';
?>
<root>
<images>
<?php
//Open images directory
$dir = dir("images");
//List files in images directory
while (($file = $dir->read()) !== false)
if (eregi("gif", $file) || eregi("jpg", $file) || eregi("png", $file))
echo "<image>" . $file . "</image>"; // i expect you to use the relative path in $dir, not C:\..........
//$dir->close();
?>
</images>
</root>
Flex Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
creationComplete="callPHP();">
<mx:Script>
<![CDATA[
import mx.rpc.http.HTTPService;
import mx.controls.Alert;
import mx.events.FlexEvent;
import mx.rpc.events.FaultEvent;
import mx.events.ItemClickEvent;
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
[Bindable]
private var arr:ArrayCollection = new ArrayCollection();
private function callPHP():void
var hs:HTTPService = new HTTPService();
hs.url = 'Picture.php';
hs.addEventListener( ResultEvent.RESULT, resultHandler );
hs.addEventListener( FaultEvent.FAULT, faultHandler )
hs.send();
private function resultHandler( event:ResultEvent ):void
arr = event.result.root.images.image as ArrayCollection;
private function faultHandler( event:FaultEvent ):void
Alert.show( "Fault Response from HTTPService call:\n " );
]]>
</mx:Script>
<mx:TileList id="tilelist"
dataProvider="{arr}">
<mx:itemRenderer>
<mx:Component>
<mx:Image source="images/{data}" />
</mx:Component>
</mx:itemRenderer>
</mx:TileList>
</mx:Application>
Maybe you are looking for
-
LACK OF FULL PEN TOOL FUNCTIONALITY WHEN CREATING A SHAPE LAYER
Hello, I'm going through Chris Meyer's video course on being an AE apprentice and have spent over an hour on the following issue. Here is what I know. I know I am trying to create a shape layer, not a mask, to create a frame to surround the video of
-
Re: Setting up free goods for a particular amount in the order.
Hello, I have a scenario which I am trying to setup. If total amount of the order exceeds $x amount, customer gets a specified free item when promotion code is entered. For Promotion code we have a Field setup and we are using for normal pricing. Can
-
Time Machine causes screen to go blank when starting backup
Time machine causes screen to go blank when it starts backup. I have cable wireless modem with ethernet to time machine; then ethernet to computer. Cable company just increased speed to 30. What may be happening? I am afraid of losing all my data.
-
Steps to upgrade SAP B1 8.8 PL10 to 8.81 PL05
Hi All, Please could someone guide me how to upgrade my system from 8.8 PL10 to 8.81 PL05. I have the downloaded file available with me with a "upgrade" application button. Should I directly click on "upgrade" button in the 8.81 PL05 folder and follo
-
Colours of imported postscript not displayed properly in illustrator
Hi, I produced a colour map and colour gradient legend as a postscript file (.ps) using generic mapping tools software running under linux. When I import this file into illustrator (in windows 8) the colour map is fine, but the colour gradient does n