473,385 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Check for various emails addresses

194 100+
Hi, I have form which have 10 fields of emails. like below

1. Friend's Name: Friend's Email:
2. Friend's Name: Friend's Email:
3. Friend's Name: Friend's Email:
4. Friend's Name: Friend's Email:
5. Friend's Name: Friend's Email:
6. Friend's Name: Friend's Email:
7. Friend's Name: Friend's Email:

each of the above field has an input also. my question is this how i can check if the email address is present on which serial number? would anybody help me my doing this with function or some other method/procedure?
Sep 25 '08 #1
6 1360
Atli
5,058 Expert 4TB
Hi.

How does the actual HTML look like?
Sep 25 '08 #2
mfaisalwarraich
194 100+
Hi.

How does the actual HTML look like?
sorry i dont understand ur question? well it is a form. which have two different input fields one is Friends Name and other is Friend's Email. i wana refer something to my at least 10 friends then how i can check that if the email address is entered at which field.
Sep 25 '08 #3
Atli
5,058 Expert 4TB
I simply mean; can we see the markup for your form?

There are a lot of different ways your form could be set up.
If we know exactly how it looks like we are not forced to guess, which means we can provide much better suggestions.

We really don't like guessing :)
Sep 25 '08 #4
mfaisalwarraich
194 100+
ok here is the code

[HTML]<form id="referfriend" method="post" style="display:none" action="advertisewithus.php?action=check">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="WHITE" align="center" >
<tr>
<td colspan="4" align="CENTER" height="25" CLASS="bluebox2" ><h3> Refer A Friend</h3></td>
</tr>
<tr class="tableText">
<td align="LEFT">Your Name</td>
<td align="LEFT" > <input name="name" type="text"></td>
<td align="RIGHT">Your Email</td>
<td align="LEFT"><input id="email" name="email" type="text"></td>
</tr>
<tr bgcolor="#FFFFFF" class="tableText">
<td align="LEFT">1. Friend Name</td>
<td align="LEFT"><input name="friendname1" type="text"></td>
<td align="RIGHT">Friend Email</td>
<td align="LEFT"><input id="friendemail1" name="friendemail1" type="text"></td>
</tr>
<tr bgcolor="#FFFFFF" class="tableText">
<td align="RIGHT">2. Friend Name</td>
<td align="LEFT" ><input name="friendname2" type="text"></td>
<td align="RIGHT">Friend Email</td>
<td align="LEFT"><input id="friendemail2" name="friendemail2" type="text"></td>
</tr>
<tr bgcolor="#FFFFFF" class="tableText">
<td align="RIGHT">3. Friend Name</td>
<td align="LEFT"><input name="friendname3" type="text"></td>
<td align="RIGHT">Friend Email</td>
<td align="LEFT"><input id="friendemail3" name="friendemail3" type="text"></td>
</tr>
<tr bgcolor="#FFFFFF" class="tableText">
<td align="RIGHT">4. Friend Name</td>
<td align="LEFT"><input name="friendname4" type="text"></td>
<td align="RIGHT">Friend Email</td>
<td align="LEFT"><input id="friendemail4" name="friendemail4" type="text"></td>
</tr>
<tr bgcolor="#FFFFFF" class="tableText">
<td align="RIGHT">5. Friend Name</td>
<td align="LEFT"><input name="friendname5" type="text"></td>
<td align="RIGHT">Friend Email</td>
<td align="LEFT"><input id="friendemail5" name="friendemail5" type="text"></td>
</tr>
<tr bgcolor="#FFFFFF" class="tableText">
<td align="RIGHT">6. Friend Name</td>
<td align="LEFT"><input name="friendname6" type="text"></td>
<td align="RIGHT">Friend Email</td>
<td align="LEFT"><input id="friendemail6" name="friendemail6" type="text"></td>
</tr>
<tr bgcolor="#FFFFFF" class="tableText">
<td align="RIGHT">7. Friend Name</td>
<td align="LEFT"><input name="friendname7" type="text"></td>
<td align="RIGHT">Friend Email</td>
<td align="LEFT"><input id="friendemail7" name="friendemail7" type="text"></td>
</tr>
<tr bgcolor="#FFFFFF" class="tableText">
<td align="RIGHT">8. Friend Name</td>
<td align="LEFT"><input name="friendname8" type="text"></td>
<td align="RIGHT">Friend Email</td>
<td align="LEFT"><input id="friendemail8" name="friendemail8" type="text"></td>
</tr>
<tr bgcolor="#FFFFFF" class="tableText">
<td align="RIGHT">9. Friend Name</td>
<td align="LEFT"><input name="friendname9" type="text"></td>
<td align="RIGHT">Friend Email</td>
<td align="LEFT"><input id="friendemail9" name="friendemail9" type="text"></td>
</tr>
<tr bgcolor="#FFFFFF" class="tableText">
<td align="RIGHT">10.Friend Name</td>
<td align="LEFT"><input name="friendname10" type="text"></td>
<td align="RIGHT">Friend Email</td>
<td align="LEFT"><input id="friendemail10" name="friendemail10" type="text"></td>
</tr>
<tr bgcolor="#FFFFFF" class="tableText">
<td align="RIGHT" WIDTH="19%">Body</td>
<td colspan="4" align="CENTER"><textarea name="mailbody" cols="20" rows="7"></textarea></td>
</tr>
<tr bgcolor="#FFFFFF">
<td colspan="4" align="center"><input name="referSubmit" id="" type="submit" value="Submit" valign="middle"></td>
</tr>
</table></form>[/HTML]
Sep 25 '08 #5
Atli
5,058 Expert 4TB
Ok.

If you give several <input> elements the same name, and if that name ends with [], then PHP will read all those elements into an array when they are submitted.
Which means you could add as many of those <input> elements as you want to your form and have your PHP go through all of them with a simple foreach loop.

So, if you were to name all your Name inputs "name[]", and all your Email inputs "email[]", then a loop like this would print the value for each of them once they were submitted:
Expand|Select|Wrap|Line Numbers
  1. foreach($_POST['name'] as $_index => $_name)
  2. {
  3.     $_email = $_POST['email'][$_index];
  4.     echo "$_index - Name: $_name, Email: $_email<br />";
  5. }
  6.  
You could use the empty and isset functions to eliminate empty rows and only use those who pass your validation.

Also...
Use [code] tags when posting you code examples.
As a full member I expect you to know this by now.
Please keep that in mind in the future.

Thank you.
Moderator
Sep 25 '08 #6
mfaisalwarraich
194 100+
Thank u for ur help n support i got ur answer i think the empty field can be eliminated using if(!$friendmail=="") then do this. and im sorry posting my reply without code tags. i appologize and sincerely hope that u shall always keep helping me. thank u once again
Sep 25 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

40
by: ian | last post by:
Hi, I'm a newbie (oh no I can here you say.... another one...) How can I get Python to send emails using the default windows email client (eg outlook express)? I thought I could just do the...
5
by: Kun | last post by:
i have the following code: ---------------------------------- import smtplib from email.MIMEText import MIMEText fp = open('confirmation.txt', 'rb') msg = MIMEText(fp.read()) From =...
6
by: CMan | last post by:
Hi, I need to check emails from a web application. Is there a simple way for the application to check whether an email arrived? Thanks C
12
by: tshad | last post by:
What would be a good way to check programmatically whether a service was running? We have a service that dies periodically and I need to check to see if this service is running. I know how to...
5
by: Jai | last post by:
Hi, I am in a problem of sending mass emails(newsletter) to my website members. Actually my problem is this: I want to send newsletter to my website members. But I had given a facility for...
10
by: ll | last post by:
Hi, I currently am using the following regex in js for email validation, in which the email addresses can be separated by commas or semicolons. The problem, however, lies in that I can type two...
4
by: kitesurfer | last post by:
Looking for some help with an email form using php. I am using check boxes in a html form, the values of check boxes are email addresses. The person visiting our site has the ability to select...
3
JohanK
by: JohanK | last post by:
Hi there, I need some help with exchange. One of the users that i have to add has multiple email addresses. So when adding the Active Directory User an exchange mail box is created for that...
5
zorgi
by: zorgi | last post by:
Hello guys I have to send HTML email to over 1000 email addresses and I believe that at some point server will stop sending them even if my script works perfect on fewer email addresses. Basically...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.