Ok so I am mr.Knownothing when it comes to scripting...
I am trying to modify this script to omit fields that are not filled in. I have checkboxes and text fields.
Here is my current script: -
<?php
-
-
-
$request_method = $_SERVER["REQUEST_METHOD"];
-
if($request_method == "GET"){
-
$query_vars = $_GET;
-
} elseif ($request_method == "POST"){
-
$query_vars = $_POST;
-
}
-
reset($query_vars);
-
$t = date("U");
-
-
$file = $_SERVER['DOCUMENT_ROOT'] . "/../data/gdform_" . $t;
-
$fp = fopen($file,"w");
-
while (list ($key, $val) = each ($query_vars)) {
-
fputs($fp,"<GDFORM_VARIABLE NAME=$key START>\n");
-
fputs($fp,"$val\n");
-
fputs($fp,"<GDFORM_VARIABLE NAME=$key END>\n");
-
if ($key == "redirect") { $landing_page = $val;}
-
}
-
fclose($fp);
-
if ($landing_page != ""){
-
header("Location: http://".$_SERVER["HTTP_HOST"]."/$landing_page");
-
} else {
-
header("Location: http://".$_SERVER["HTTP_HOST"]."/");
-
}
-
-
-
-
?>
-
-
Here is what I think I have to add to it:
-
-
if (is_array($val)) {
-
for ($z=0;$z<count($val);$z++) {
-
-
if(strlen($val[$z])>0) // If the length of your value is greater than
-
zero, then include it
-
{ $content .= "$key: $val[$z]\n"; }
-
-
}
-
} else {
-
$content .= "$key: $val\n";
-
}
-
I am not sure if that is correct or how to add it into the script. Sorry for such an ignorant question.
-Todd
2 1282 kovik 1,044
Recognized Expert Top Contributor
Maybe empty() would be of interest to you.
pbmods 5,821
Recognized Expert Expert
Heya, Todd. Welcome to TSDN!
Please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Raphael Gluck |
last post by:
Hi all
I am still finding my feet creating a website in ASP, and i'm trying to get
to grips with users providing feeback to my site.
my webhosts have the dundas mailer installed, and i am trying to get it to
work for me.
does it work in conjuction with regular html? can i add a <form> and text
fields? and then will all that get sent with the page?
I have a little script but i dont know how to modify it
|
by: John Davis |
last post by:
What is the **MOST** obvious reason why will this will fail (it's not syntax
or anything specific to the object)?
Function Mail(MailerProgram, Message, Subject, Format, FromEmail, ToEmail,
ReplyTo, FromName, ToName, MailerPath, BCCEmail, Attachement)
Set Mailer = Server.CreateObject("Persits.MailSender")
if NOT isObject(Mailer) Then
Mail = false
Exit function
|
by: Flopper |
last post by:
Hey can anyone help me with a WORKING anonymous mailer php script.
I've looked on the net but only find non working one's.
Greetings Floppie
|
by: Beyza |
last post by:
Hi,
I have a problem. One of my customer used to use php mailer in her
web page. But when i changed something in the system (php packages) ,
it was broken. If she use php-mailer in her system, mails come base64
code. I did not understand why. Do you have any idea?
I am pasting example mail header.
: 55902;
:25;Sat, 29 Jul 2006 05:51:26 -0500
|
by: =?Utf-8?B?TWlrZSBI?= |
last post by:
I'm using a block of ASP to allow a user to send a form via e-mail.
However, someone keeps sending me spam through this form
and they're using a bogus return address. I'm testing for a
successful send, which should fail if the return address is
not valid, but I'm still getting the junk.
The block looks like this:
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.RemoteHost = "smtp.xxx.com"
Mailer.FromName =...
| |
by: kind1one |
last post by:
I am green to PHP and trying to create outside PHP mailer for html form ,i found the script i need but I can't get it to upload more than one file ,since i do not know exactly where to place script request for file2-file10 as well as the exact line to place extension control and size limit ,SOS , any help would be aprishiated
the mailer script:
<?php
if (strpos($_SERVER, $_SERVER)>7 ||
!strpos($_SERVER, $_SERVER))
...
|
by: askzda |
last post by:
Hi,
Can somebody pls help to solve above problem. I have used dundas mailer for my mailing part in my asp script, but the an error occured during sending the mail. Error that is prompted out just like below:
Dundas.Mailer.1 error '80004005'
The DATA command failed.
I've checked all the recepients' email adresses and they all valid. SO, kindly help me to solve this kind error. I really appreciate ur help.
|
by: patrickinminneapolis |
last post by:
Hi guys,
I'm trying to write an emailer, but I can't manage to construct the object properly. Here's what I've got:
#!/usr/local/bin/perl -w
use Net::SMTP;
$smtp = Net::SMTP->new('mailhost');
print $smtp->domain,"\n";
$ perl mailer.txt
Can't call method "domain" on an undefined value at mailer.txt line 6.
|
by: Dave Kelly |
last post by:
Sorry for the long post, it is easier to discard information than
to have to wait for it to arrive.
So here goes:
This code worked perfectly when I was an Earthlink customer. Sprint
decided not to pardner with Earthlink and create their own IP. Since
then everything email has been broke.
Sprint/Embarq is the only copper wire DSL provider where I live.
|
by: neovantage |
last post by:
hey geeks,
I have a small mail script which will cause a PHP script to send a receipt upon clicking the submit button, by an HTML mail. This mail contains special characters, namely 'å', 'ä' and 'ö'. Whatever I try, I can't get these characters to display properly everywhere. In some email clients, these characters show up just fine, whereas in others they show up as question marks or kinda boxes. I've tried sending the mail as UTF-8, as...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |