Since noone answered the questions in my 2nd post, I tried getting 'em answered at another site, and got a vague answer with a couple bits of code. So I still have some questions I need answers to and thought I'd try this forum again. Here they are, with quotes from the person that replied.
If the .inc file is displayed in HTML to the user, then they will be able to parse the webpage for the information.
Ok. Well, both the thesitewizard and AContact scripts store the email address in a PHP file, which thesitewizard claims is inaccessible to bots. But I was wondering if storing the address in an .inc file would make it accessible to bots, either by being in an .inc file as opposed to a PHP file - even though the .inc file starts with <?php and ends with ?>, or when being retrieved from it by the PHP contact form. I don't how PHP works, but it won't be displayed in HTML, will it, with the php contact form getting the email address from the .inc file?
Not the exact because I am unsure how your arrays are set up in the first place.
I haven't set 'em up yet, 'cause I don't know how. That's why I asked those questions and am asking more.
Do you mean should you define the array before filling it in? Sure. $myArray = array();
Yesterday I learned there are two different ways to write the array I'm using. One's like that, with the variables in between the parentheses separated by a =>, and the other like the following code I was given. So correct me if I'm wrong, but it appears I would only use the $myArray code to define the array if I was writing it that way. But if I write it the other way, the following should be all the code I need in the .inc file, right?
<?php
$person[0]['name'] = 'Name';
$person[0]['email'] = 'name@address.com';
$person[1]['name'] = 'Name';
$person[1]['email'] = 'name@address.com';
?>
Where does the following code go? In the .inc file or the PHP form file? The person who replied didn't say. And where exactly in the file? If in the .inc file, before the code I posted above, instead of it? Or where?
// Go through the top most array
foreach($myArray as $something => $miniArray) {
// Now I can pull the information I want from the inner arrays
$name = $miniArray[0];
$email = $miniArray[1];
next;
}
I assume the following code goes in the PHP contact form file? Where exactly? If you don't have AContact Form, could you please download it and look at the contact.php file to see where the code should go? 'Cause the code for it would take up quite a bit of space here. Or should I post it anyway?
// URL looks like http://mysite.com/page.php?person=0
//Check to see if the variable is set
if (isset($_GET['person'])) {
// Grab the value
$value = $_GET['person']
// Get that particular item from the array and spill its contents
print_r($myArray[$person]);
}
The person who replied says it spills it's contents, but I don't want it to print / display the email address. Just the person's name. With that code and the php?person=0 query string, how does the form know to get and print that person's name instead of the email address? I would think I'd have to include ["name"] somewhere in the code, like in the following code.
Use this one:
<h1>Contact <? print($person[$_GET["1"]["name"]]); ?></h1>
Ok. Well I didn't realize it at the time, but that code will only work for person 1's name, huh? In other words, I'd only be able to use the form for that one person. If I get rid of ["1"] or as you said [1] would it be correct? Like this?
<h1>Contact <? print($person[$_GET["name"]]); ?></h1>
Or do I need to use the isset / print_r code above instead?
(though I put my varibles into something and try not to use the $_GET over and over)
Does the code the person posted show that? If not, what does the code look like for that in the .inc file? And what does it look like in the PHP file for both printing the name and getting the email address? If you could list all the code I need to add to the PHP file, and all the code I need to put in the .inc file, that'd be great. But if you feel that's going too far, I'll just keep asking questions until I hopefully get this straight.