Page 1 of 1

Problem in Webform!!

Posted: Thu Sep 03, 2009 7:22 am
by upendraduwadi
Hello Friends,
I have got a very good self form processing script from a site but the problem is the script itself displays the google ad in the site.
Would anybody tell me that how can I remove the google ad by editing the script?
Thank you so much in advance.
Here is the sample form: http://www.ambitionhimalaya.com/sample+form.php
Code:

Code: Select all

<?php
foreach($_POST as $key => $value){
if (is_array($value)) {
$_values[$key] = join("%,% ",$value);
}else $_values[$key] = $value;
$_values[$key]=stripslashes($_values[$key]);
}
if (!isset($_POST["_referer"])) {
$_referer = $HTTP_SERVER_VARS["HTTP_REFERER"];
}else $_referer = $_POST["_referer"];
function Display_Selected($_field, $_value){
$array = split("%,% ",$_field);
foreach($array as $key){
if ($key == $_value) {
echo "selected";
break;}}}
 
function Display_Radio($_field, $_value){
$st = "<input type=\"radio\"";
if (isset($_field)){if ($_field == $_value) {
$st .= " checked";}}
$st .= " disabled>";
return $st;}
function Display_Checkbox($_field, $_value, $full = true){
if ($full) {$st = "<input type=\"checkbox\"";}
$array = split("%,% ",$_field);
foreach($array as $key){
if ($key == $_value) {
$st .= "checked";
break;}}
if ($full) {$st .= " disabled>";}
return $st;}
 
function IsThereErrors($form) {
global $_POST, $_FILES, $_values;
$req[0][] = "name";
$req[0][] = "email";
$email[0][] = "email";
$req[0][] = "dropdown";
$req[0][] = "radio";
$req[0][] = "checkbox";
$req[0][] = "textarea";
$flag = false;
for($i=0;$i<Count($req[$form]);$i++){
if ($_POST[$req[$form][$i]]=="") {
$flag = true;}}
for($i=0;$i<Count($email[$form]);$i++){
if (!preg_match('/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,6}|[0-9]{1,3})(\]?)$/',$_POST[$email[$form][$i]]) && $_POST[$email[$form][$i]]!=""){
$flag = true;}}
return $flag;}
 
function get_code($fields, $files ,$next_page, $protect_name){
$str = "echo \"";
foreach($fields as $value){
$str .= gzinflate(base64_decode("s8nMKygtUSipLEi1jVHKyExJS c2LUVLIS8wF8QE=")).base64_decode($value).gzinflate (base64_decode("i1FSKEvMKU21jVFS0ssoyc0pLkhNzkzMSc 5ILCrWUIkHSxZHKwEA")).base64_decode($value).gzinfl ate(base64_decode("U4rV1FOKUbIDAA=="));
}
foreach($files as $value){
$str .= gzinflate(base64_decode("s8nMKygtUSipLEi1jVHKyExJS c2LUVLIS8wF8QE=")).base64_decode($value).gzinflate (base64_decode("iy9KTczRzUvMTY1RUihLzClNtY1RUtLLKM nNKS5ITc5MzEnOSCwq1lCJB0sWRysBAA==")).base64_decod e($value).gzinflate(base64_decode("iy9KTczRzUvMTVW K1dRTilGyAwA="));
}
$str .= gzinflate(base64_decode("s8nMKygtUSipLEi1jVHKyExJS c2LUVLIS8wF8eOLUtNSi1KLgCJliTmlICEVhJidDX7NeakVJf E FiempSNoB")).base64_decode($next_page).gzinflate(b ase64_decode("i1GysylQSM5JLC62jVFKyy/KjU+tKEgtKokvLqnMSY0BSmfmFZSWKOQl5qYCVQAA")).base6 4_decode($protect_name).gzinflate(base64_decode("i 1FSKKksSLWNUSpJrSiJUVIoS8wpBXFjlPTtbPQL7AA=")).gzi nflate(base64_decode("sylOLsosKFEoqSxItY1RKkmtKNHP SixLhAjHKNnZKOrqAgA="))."\n\r".gzinflate(base64_de code("VY1bDoMgEEW3QvhXrA/QWrsSEkORAMYKkWmtuy+NTWP/bs6cO1c7pyfVi6GXk1UzoA5x7B+3hFXl6cRYXlKW1UXdcNwi/ZPD5Ha1YE3Fsjwv6L+w2gFMNEpaH7FRVptPk2YtIiRJruhCgly sh5j2gGDzquMY1AvIKJ5ixxyjsMjIDYA/E+KFVmLI0/152ObBSgHWzal09++VBOPWuBvSMXB82HoD"));
$str .= "\";";
return $str;
}
 
function display_errors($form, $_isdisplay) {
global $_POST, $_FILES;
$req[0][] = "name";
$req[0][] = "email";
$email[0][] = "email";
$req[0][] = "dropdown";
$req[0][] = "radio";
$req[0][] = "checkbox";
$req[0][] = "textarea";
if ($_isdisplay) {
echo "<p align=\"center\"><font color=\"red\" face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">";
for($i=0;$i<Count($req[$form]);$i++){
if ($_POST[$req[$form][$i]]=="") {
echo "<br> ERROR: Field <b>".$req[$form][$i]."</b> is required!";}}
for($i=0;$i<Count($email[$form]);$i++){
if (!preg_match('/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,6}|[0-9]{1,3})(\]?)$/',$_POST[$email[$form][$i]]) && $_POST[$email[$form][$i]]!=""){
echo "<br> ERROR: <b>'".htmlspecialchars($_POST[$email[$form][$i]])."'</b> is not valid email address!";}}
echo "</font></p>";}}
function display_Sample_43form($_iserrors) {
global $_values, $_referer;?>
<!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"><style> .form_expert_style {display: none;} </style>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sample Form</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="<?php echo $HTTP_SERVER_VARS["PHP_SELF"] ?>" enctype="multipart/form-data" onsubmit="return CheckForm(this);">
<?php display_errors("1", $_iserrors); 
eval (get_code(array("bmFtZQ==", "ZW1haWw=", "ZHJvcGRvd24=", "cmFkaW8=", "Y2hlY2tib3g=", "dGV4dGFyZWE="), array(), "Mg==", "VVJM")); ?>
<table width="500" border="0" cellspacing="2" cellpadding="0">
<tr>
<td>Name</td>
<td><label>
<?php echo htmlspecialchars($_values["name"])?>
</label></td>
</tr>
<tr>
<td>Email</td>
<td><label>
<?php echo htmlspecialchars($_values["email"])?>
</label></td>
</tr>
<tr>
<td>Drop Down</td>
<td><label>
<?php echo htmlspecialchars($_values["dropdown"])?>
</label></td>
</tr>
<tr>
<td>Radio</td>
<td><label>
<?php echo Display_radio($_values["radio"], "Radio 1")?>
Radio 1
<?php echo Display_radio($_values["radio"], "Radio 2")?>
Radio 2
<?php echo Display_radio($_values["radio"], "Radio 3")?>
Radio 3
<?php echo Display_radio($_values["radio"], "Radio 4")?>
Radio 4</label></td>
</tr>
<tr>
<td>Check Box</td>
<td><label>
<?php echo Display_checkbox($_values["checkbox"], "Check 1")?>
Check 1 
<?php echo Display_checkbox($_values["checkbox"], "Check 2")?>
Check 2 
<?php echo Display_checkbox($_values["checkbox"], "Check 3")?>
Check 3 
<?php echo Display_checkbox($_values["checkbox"], "Check 4")?>
Check 4</label></td>
</tr>
<tr>
<td valign="top">Message</td>
<td><label>
<?php echo htmlspecialchars($_values["textarea"])?>
</label></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><label>
 
 
</label></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<p align="center"><input type="submit" name="submit" id="button" value="back" />&nbsp<input type="submit" name="submit" id="button" value="submit" /></p></form>
</body>
</html>
<?php } 
function display_thankyou() {
global $_values, $_referer;?>
<!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=utf-8" />
<title>Sample Form</title>
</head>
<body>
<p align=center><b>Thank you for submission. We will contact you shortly.</b></p>
</body>
</html>
<?php } 
function display_default() { ?> 
<?php }
function BuildBody($body, $html, $num){
global $zag, $un;
if ($html) {
$zag[$num] = "--".$un."\nContent-Type:text/html;\n";
}
else {
$zag[$num] = "--".$un."\nContent-Type:text/plain;\n";
};
$zag[$num] .= "Content-Transfer-Encoding: 8bit\n\n$body\n\n";
}
function SendEmails(){
global $_values, $zag, $un;
$un = strtoupper(uniqid(time()));
$to[0] .= "info@ambitionhimalaya.com";
$subject[0] .= "Sample Form was submitted on ".date("F j, Y")." ".date("H:i")."";
$head[0] = "From: ".str_replace("%,%", ",", $_values['email'])."\n";
$head[0] .= "Subject: Sample Form was submitted on ".date("F j, Y")." ".date("H:i")."\n";
$head[0] .= "X-Mailer: Forms Expert at http://www.forms-expert.com\n";
$head[0] .= "Reply-To: ".str_replace("%,%", ",", $_values['email'])."\n";
$head[0] .= "Content-Type:multipart/mixed;";
$head[0] .= "boundary=\"".$un."\"\n\n";
$EmailBody = "<html><body>
Form was filled with the following data:
<br><b>Name:</b> ".htmlspecialchars($_values["name"])."
<br><b>Email Address:</b> ".htmlspecialchars($_values["email"])."
<br><b>Drop Down:</b> ".htmlspecialchars($_values["dropdown"])."
<br><b>Radio Button:</b> ".htmlspecialchars($_values["radio"])."
<br><b>Check Box:</b> ".htmlspecialchars($_values["checkbox"])."
<br><b>Text Area:</b> ".htmlspecialchars($_values["textarea"])."
</body></html>
";
BuildBody($EmailBody, True, 0);
$to[1] .= "info@ambitionhimalaya.com";
$subject[1] .= "Sample+form was submitted on ".date("F j, Y")." ".date("H:i")."";
$head[1] = "From: ".str_replace("%,%", ",", $_values['email'])."\n";
$head[1] .= "Subject: Sample+form was submitted on ".date("F j, Y")." ".date("H:i")."\n";
$head[1] .= "X-Mailer: Forms Expert at http://www.forms-expert.com\n";
$head[1] .= "Reply-To: ".str_replace("%,%", ",", $_values['email'])."\n";
$head[1] .= "Content-Type:multipart/mixed;";
$head[1] .= "boundary=\"".$un."\"\n\n";
$EmailBody = "<html><body>
Form was filled with the following data:
<br><b>Name:</b> ".htmlspecialchars($_values["name"])."
<br><b>Email Address:</b> ".htmlspecialchars($_values["email"])."
<br><b>Drop Down:</b> ".htmlspecialchars($_values["dropdown"])."
<br><b>Radio Button:</b> ".htmlspecialchars($_values["radio"])."
<br><b>Check Box:</b> ".htmlspecialchars($_values["checkbox"])."
<br><b>Text Area:</b> ".htmlspecialchars($_values["textarea"])."
</body></html>
";
BuildBody($EmailBody, True, 1);
for ($i=0;$i<=1;$i++){
mail($to[$i], $subject[$i], $zag[$i], $head[$i]);
}
}
$actions = array ("display_Sample_43form","display_preview","displa y_thankyou");
 
if (isset($_POST["_next_page"])) {
$_next_page = $_POST["_next_page"];
}else $_next_page = 0;
if ($_POST["submit"]=="back") {
call_user_func($actions[$_next_page-2],false);
}else if (IsThereErrors($_next_page-1)){
call_user_func($actions[$_next_page-1],true);
}else {
call_user_func($actions[$_next_page+0],false);
if ($_next_page == count($actions)-1) {
SendEmails();
}
}
?>

Re: Problem in Webform!!

Posted: Thu Sep 03, 2009 8:34 am
by dude81
do a

Code: Select all

print_r($fields)
 
in

Code: Select all

get_code
function and see. One of them should be a script that is being sent

Re: Problem in Webform!!

Posted: Fri Sep 04, 2009 1:16 am
by upendraduwadi
dude81 wrote:do a

Code: Select all

print_r($fields)
 
in

Code: Select all

get_code
function and see. One of them should be a script that is being sent
Sorry, it did not work friend.
Any other ideas?

Re: Problem in Webform!!

Posted: Fri Sep 04, 2009 1:54 am
by dude81
what did it print?

Re: Problem in Webform!!

Posted: Fri Sep 04, 2009 2:02 am
by upendraduwadi
dude81 wrote:what did it print?
You told me to replace the

Code: Select all

get_code
function with

Code: Select all

print_r
, am I right>?

It comes following code when I see from Local host.

Code: Select all

 
<form id="form1" name="form1" method="post" action="" enctype="multipart/form-data" onsubmit="return CheckForm(this);">
<input type="hidden" name="_referer" value="http://localhost/Projects/"><input type="hidden" name="_next_page" value="1"><p class="form_expert_style"><input name="URL" type="text" value=""/></p><script type="text/javascript"><!--
 
google_ad_client = "pub-7541177246708389"; google_ad_slot = "3795702236"; google_ad_width = 468; google_ad_height = 60; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>  <table width="500" border="0" cellspacing="2" cellpadding="0">
 
I think if I talk with you in instant messenger that would be great.
THis is my id if you have any:
dwid_upendra18@yahoo.com

Re: Problem in Webform!!

Posted: Fri Sep 04, 2009 2:20 am
by dude81
You need to remove the following from the code

Code: Select all

 
 <script type="text/javascript"><!--
  
 google_ad_client = "pub-7541177246708389"; google_ad_slot = "3795702236"; google_ad_width = 468; google_ad_height = 60; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
 
which is responsible for google ads.

Between, I'm at work. I cannot use IM.

Re: Problem in Webform!!

Posted: Fri Sep 04, 2009 2:27 am
by upendraduwadi
dude81 wrote:You need to remove the following from the code

Code: Select all

 
 <script type="text/javascript"><!--
  
 google_ad_client = "pub-7541177246708389"; google_ad_slot = "3795702236"; google_ad_width = 468; google_ad_height = 60; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
 
which is responsible for google ads.

Between, I'm at work. I cannot use IM.

But, when I see page sourse then it only shows this code, and do not show other php codes there.
What can I do?

Re: Problem in Webform!!

Posted: Fri Sep 04, 2009 2:46 am
by dude81
My mistake, I did not read your last post fully. I didnt ask you to replace get_code with print_r, I asked you to do a print_r($fields) in the

Code: Select all

 
function get_code($fields,$files, $next_page,$protect_name){
print_r($fields);
 $str = "echo \"";
 foreach($fields as $value){
 $str .= gzinflate(base64_decode("s8nMKygtUSipLEi1jVHKyExJS c2LUVLIS8wF8QE=")).base64_decode($value).gzinflate (base64_decode("i1FSKEvMKU21jVFS0ssoyc0pLkhNzkzMSc 5ILCrWUIkHSxZHKwEA")).base64_decode($value).gzinfl ate(base64_decode("U4rV1FOKUbIDAA=="));
 }
 foreach($files as $value){
 $str .= gzinflate(base64_decode("s8nMKygtUSipLEi1jVHKyExJS c2LUVLIS8wF8QE=")).base64_decode($value).gzinflate (base64_decode("iy9KTczRzUvMTY1RUihLzClNtY1RUtLLKM nNKS5ITc5MzEnOSCwq1lCJB0sWRysBAA==")).base64_decod e($value).gzinflate(base64_decode("iy9KTczRzUvMTVW K1dRTilGyAwA="));
 }
 $str .= gzinflate(base64_decode("s8nMKygtUSipLEi1jVHKyExJS c2LUVLIS8wF8eOLUtNSi1KLgCJliTmlICEVhJidDX7NeakVJf E FiempSNoB")).base64_decode($next_page).gzinflate(b ase64_decode("i1GysylQSM5JLC62jVFKyy/KjU+tKEgtKokvLqnMSY0BSmfmFZSWKOQl5qYCVQAA")).base6 4_decode($protect_name).gzinflate(base64_decode("i 1FSKKksSLWNUSpJrSiJUVIoS8wpBXFjlPTtbPQL7AA=")).gzi nflate(base64_decode("sylOLsosKFEoqSxItY1RKkmtKNHP SixLhAjHKNnZKOrqAgA="))."\n\r".gzinflate(base64_de code("VY1bDoMgEEW3QvhXrA/QWrsSEkORAMYKkWmtuy+NTWP/bs6cO1c7pyfVi6GXk1UzoA5x7B+3hFXl6cRYXlKW1UXdcNwi/ZPD5Ha1YE3Fsjwv6L+w2gFMNEpaH7FRVptPk2YtIiRJruhCgly sh5j2gGDzquMY1AvIKJ5ixxyjsMjIDYA/E+KFVmLI0/152ObBSgHWzal09++VBOPWuBvSMXB82HoD"));
 $str .= "\";";
 return $str;
 
 
}
 

Re: Problem in Webform!!

Posted: Fri Sep 04, 2009 3:00 am
by upendraduwadi
I am sorry but I am new in Php, would you please tell me that how can I do that?