Lowyat.NET Forums

Welcome Guest ( Log In | Register )

 
RSS feedBump TopicReply to this topicStart new topicStart Poll

Outline · [ Standard ] · Linear+

> error #2101, need help ! thx

farmcow
post Jun 30 2009, 11:58 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #1


Getting Started
**

Group: Junior Member
Posts: 118
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jul 2007





i've created a contact form in flash but when i try to send msg this error popped out, anyone knows how to solve this problem ?


error msg

Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
at Error$/throwError()
at flash.net::URLVariables/decode()
at flash.net::URLVariables()
at flash.net::URLLoader/onComplete()


//Hide processing mclip
processing_mc.visible = false;

var variables:URLVariables = new URLVariables;

//Build the varSend variable
var varSend:URLRequest = new URLRequest("form.php");
varSend.method = URLRequestMethod.POST;
varSend.data = variables;

//Build the varLoader variable
var varLoader:URLLoader = new URLLoader;
varLoader.dataFormat = URLLoaderDataFormat.TEXT;
varLoader.addEventListener(Event.COMPLETE,completeHandler);

//Handle for the PHP script completion and status
function completeHandler(event:Event):void{
//Remove processing mclip
processing_mc.visible = false;
name_txt.text = "";
email_txt.text = "";
msg_txt.text = "";

//Load the response from PHP here
status_txt.text = event.target.data.return_msg;
}

//Add event listener for submit button click
submit_btn.addEventListener(MouseEvent.CLICK,ValidateAndSend);

//Function ValidateAndSend
function ValidateAndSend(event:MouseEvent):void{
//Validate fields
if(!name_txt.length){
status_txt.text = "Please enter your name !";
}else if(!email_txt.length){
status_txt.text = "Please enter your email !";
}else if(!validateEmail(email_txt.text)) {
status_txt.text = "Please enter a VALID email address";
}else if(!msg_txt.length){
status_txt.text = "Please enter your message !";
}else{
//Send data to PHP
processing_mc.visible = true;

//Ready the variables in the form for sending
variables.userName = name_txt.text;
variables.userEmail = email_txt.text;
variables.userMsg = msg_txt.text;

//Send form to PHP
varLoader.load(varSend);
status_txt.text = "Waiting for server connection...";

}//Close else condition for error handling
}

//Validate Email
function validateEmail(str:String):Boolean {
var pattern:RegExp = /(\w|[_.\-])+@((\w|-)+\.)+\w{2,4}+/;
var result:Object = pattern.exec(str);
if(result == null) {
return false;
}
return true;
}

here's my php code


<?php

//Create local variables from the Flash ActionScript
$senderName = $_POST['userName'];
$senderEmail = $_POST['userEmail'];
$senderMessage = $_POST['userMsg'];

//Strip slashes on the local type-in variables
$senderName = stripslashes($senderName);
$senderEmail = stripslashes($senderEmail);
$senderMessage = stripslashes($senderMessage);

$to = "my@hotmail.com";
$from = "$senderEmail";
$subject = "FIT";
$message = "FIT enquiries:

Name: $senderName
Email: $senderEmail

Their Message is below:

$senderMessage";

$headers = "From: $from\r\n";
$headers .= "Content-type: text\r\n";
$to = "$to";

//Send the email
mail($to, $subject, $message, $headers);

$my-msg = "Thanks $senderName, all data has been sent!";
print "return_msg=$my_msg";
exit();
?>

This post has been edited by farmcow: Jul 18 2009, 12:39 AM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
ktleow
post Jul 1 2009, 12:04 AM
Show posts by this member only |This post's rating (0+, 0-) | Post #2


Newbie
*

Group: Junior Member
Posts: 6
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Mar 2005
From: Malaysia





for php to work, you need to setup a web server (apache)
google that smile.gif
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
dkk
post Jul 1 2009, 03:57 AM
Show posts by this member only |This post's rating (0+, 0-) | Post #3


Casual
***

Group: Junior Member
Posts: 471
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jan 2003




Download xampp portable instead. Much easier. I prefer the lite package. Apache, MySQL, PHP, Perl. PphpMyAdmin.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
hueyseng84
post Jul 1 2009, 11:41 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #4


My dearest little goldfish
*****

Group: Senior Member
Posts: 818
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jan 2003
From: screaming at Screamyx!!!




yeap... as dkk suggested... xampp is a good package bundle for php....
other alternative is wampserver
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
farmcow
post Jul 2 2009, 02:50 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #5


Getting Started
**

Group: Junior Member
Posts: 118
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jul 2007





i've finally set-up php in my windows but an error occurred....anyone know what is the problem ? pls help thanks

here's the error

Unable to load dynamic library 'C:\Program Files\PHP\ext\php_oci8.dll'
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
RuFusS
post Jul 2 2009, 05:43 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #6


Newbie
*

Group: Junior Member
Posts: 11
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Dec 2006
From: MMU






QUOTE(farmcow @ Jul 2 2009, 02:50 PM)
i've finally set-up php in my windows but an error occurred....anyone know what is the problem ? pls help thanks

here's the error

Unable to load dynamic library 'C:\Program Files\PHP\ext\php_oci8.dll'
*


i dont know how to resolve the error.. but why dont u try Xampp like the others recommended.. its an all in one MySQL, PHP and Perl. but makesure u uninstall skype(if u r using that is) because apache uses the same port skype is using that is port 80(if im not mistaken...) correct me if im wrong..

neways guys.. do help me out.. ive succesfully installed xampp.. the problem is my browser(firefox) do not seem to have activate the php function.. but when i check wp_admin status it says that it is activated.. any ideas how to resolve? thanks in advance..

This post has been edited by RuFusS: Jul 2 2009, 05:44 PM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
dkk
post Jul 3 2009, 01:45 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #7


Casual
***

Group: Junior Member
Posts: 471
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jan 2003




What is the url in the address bar of the webbrowser?

If it says something like file:///c:/temp/test.html
this means your browser is loading directly.

If it says something like http://localhost/test.html
this means your browser is loading it from your local webserver.

The php pre-processor runs on the webserver. If you load the file directly on the browser and bypass the webserver, php commands will not be executed.

You can also check this by select view-source from the webbrowser. You should not see php code in there.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
ktleow
post Jul 4 2009, 02:01 AM
Show posts by this member only |This post's rating (0+, 0-) | Post #8


Newbie
*

Group: Junior Member
Posts: 6
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Mar 2005
From: Malaysia





QUOTE(farmcow @ Jul 2 2009, 02:50 PM)
i've finally set-up php in my windows but an error occurred....anyone know what is the problem ? pls help thanks

here's the error

Unable to load dynamic library 'C:\Program Files\PHP\ext\php_oci8.dll'
*



The extension php_oci8.dll requires Oracle 8 to be installed first. Thats why you're getting the unable to load bla bla...
Don't install this extension. That should solve your prob.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
xsan
post Jul 4 2009, 06:15 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #9


Casual
***

Group: Junior Member
Posts: 356
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jul 2006
From: Ampang Ad Libitum [ Left Hand Society ]






im suggesting u use EasyPHP..
setting up manually can give so much trouble sweat.gif
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
feeyeah
post Jul 7 2009, 04:56 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #10


Newbie
*

Group: Junior Member
Posts: 28
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jul 2009




open your php.ini.

Find this line:
[PHP_OCI8]
extension=php_oci8.dll

Change it to:
[PHP_OCI8]
#extension=php_oci8.dll

You should just include those dll that you are using.
Hope this help, thanks.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
everling
post Jul 7 2009, 08:11 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #11


Enthusiast
*****

Group: Senior Member
Posts: 778
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Feb 2008




QUOTE(xsan @ Jul 4 2009, 06:15 PM)
im suggesting u use EasyPHP..
setting up manually can give so much trouble sweat.gif
*


That isn't enabled by default in the manual set up.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
farmcow
post Jul 15 2009, 10:48 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #12


Getting Started
**

Group: Junior Member
Posts: 118
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jul 2007





new post pls help ppl thanks
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
bubblenetics
post Jul 16 2009, 01:09 AM
Show posts by this member only |This post's rating (0+, 0-) | Post #13


Newbie
*

Group: Junior Member
Posts: 49
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jul 2009





QUOTE(farmcow @ Jun 30 2009, 11:58 PM)
hi, i've installed xampp on my desktop but i cant get it run on the browser

i've placed my folder under c:\xampp\htdocs\project together with my flash and php file in it but it wont work when i try to run it in browser

here's my url: http://localhost/xampp/htdocs/project/contact.php

pls help me thanks smile.gif
*


this is the correct url smile.gif
http://localhost/project/contact.php
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
wizztjh
post Jul 17 2009, 04:16 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #14


Newbie
*

Group: Junior Member
Posts: 11
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jun 2009





QUOTE(farmcow @ Jun 30 2009, 11:58 PM)
hi, i've installed xampp on my desktop but i cant get it run on the browser

i've placed my folder under c:\xampp\htdocs\project together with my flash and php file in it but it wont work when i try to run it in browser

here's my url: http://localhost/xampp/htdocs/project/contact.php

pls help me thanks smile.gif
*




Try localhost in browser already? Can u get the orange thing?
Did u start the xampp?
Are using linux or windows , u use xampp lite or binary?
After u press xampp in program place(tooo long didnt use windows d .. .. .. i mean the place where all the programs show) anything showed?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Bump TopicReply to this topicTopic OptionsStart new topic
 



----debug section please ignore----
Lo-Fi Version Time is now: 25th November 2009 - 12:16 PM
All Rights Reserved 2003-2009 Vijandren Ramadass (~living on a prayer~)