Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Created a form and found simple php script to send results to email doesn't work

New Here ,
Jul 05, 2011 Jul 05, 2011

I've created a form and put it on my site but right now it's only a pseudo form because it does nothing, when submit is hit. I've found this php script and modified it to send the results to my email. When the form's filled out and submit is hit, the visitor is sent to the actual php page, even though they should go to a refreshed version of my site. This is the name of my site ( www.theapartmentinsiders.com ) where the nonfunctioning form resides and here is the php code that I've modified and uploaded into the scripts folder:

<?php

//--------------------------Set these paramaters--------------------------

// Subject of email sent to you.

$subject = 'You have a message from your site';

// Your email address. This is where the form information will be sent.

$emailadd = 'alan@theapartmentinsiders.com';

// Where to redirect after form is processed.

$url = 'http://www.theapartmentinsiders.com';

// Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.

$req = '0';

// --------------------------Do not edit below this line--------------------------

$text = "Results from form:\n\n";

$space = ' ';

$line = '

';

foreach ($_POST as $key => $value)

{

if ($req == '1')

{

if ($value == '')

{echo "$key is empty";die;}

}

$j = strlen($key);

if ($j >= 20)

{echo "Name of form element $key cannot be longer than 20 characters";die;}

$j = 20 - $j;

for ($i = 1; $i <= $j; $i++)

{$space .= ' ';}

$value = str_replace('\n', "$line", $value);

$conc = "{$key}:$space{$value}$line";

$text .= $conc;

$space = ' ';

}

mail($emailadd, $subject, $text, 'From: '.$emailadd.'');

echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';

?>

If I can get this form to work, I'll be beyond thrilled. By work I mean, e-mail me the results and redirect the site vistor to a designated page.

Thanks in advance.

TOPICS
Server side applications
1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 06, 2011 Jul 06, 2011

On your website your form action points to /gdform.php

Is that the name of the php file that you provided in the post? gdform.php is a default form script provided by godaddy.

Additionally, your homepage is a single jpeg. This is bad practice. No text is indexed and the large image file takes a very long time to download and display on a visitors browser.

best,

Shocker

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 06, 2011 Jul 06, 2011

Thank you. Since posting the question, I called my host provider to see if they had php scripts and they did. All I had to do was adjust the form setting to point to their (godaddy) php script (which was alreay in my scripts folder) by simply putting the file name, gd.php in the Action box. After that all I had to do was go to my account on the host's web site to choose an email address for the form contents to be sent to. After all the efforts I made at trying to do the php myself, I'm surprised at how easy this turned out to be. I thought at the very least I'd have to put in individual code for each field within the form.

I do want to recreate my site so that it's no longer image based but I have to figure out how to make it look similar with dw. Until then, is there some kind of way to put text on my site so that it can still be indxed? Perhaps in small font or behind the image or some other method?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 06, 2011 Jul 06, 2011

bestplaceinaustin wrote:

I do want to recreate my site so that it's no longer image based but I have to figure out how to make it look similar with dw. Until then, is there some kind of way to put text on my site so that it can still be indxed? Perhaps in small font or behind the image or some other method?

Not recommended.

Read the Black hat marketing section of this page: http://en.wikipedia.org/wiki/White_or_black_hat#Black_hat_marketing

best,

Shocker

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 06, 2011 Jul 06, 2011

woops! Thanks. I'll be sure not to do that.

If only the text from the image is used in a legitimate way, I wonder if it's still considered black hat or at least reduced down to grey hat -- not that I'd even intentionally practice either.

What if I used the text from the actual image and pasted that into the alternate text description? Is that acceptable?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 06, 2011 Jul 06, 2011

bestplaceinaustin wrote:

What if I used the text from the actual image and pasted that into the alternate text description? Is that acceptable?

Acceptable? questionable.

Effective? meh.

Recommended? No.

Replacing text in image is recommended.

best,

Shocker

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 06, 2011 Jul 06, 2011

Just to see what would happen, I searched for the exact words in my site's name (something nobody would ever search for unless they were searching for my site) and came up on the top of the 4th page - small fish in a small pond. Interestingly enough, the google description wasn't only the spry titles but also included sentences within my jpeg. Does this mean that google is searching the text within the image and giving it some weight? My alternate guess is that google is simply mirroring the text from my site once it has already ranked the page. But still, this mirroring is converting image to text because those sentences are not writte anywhere else.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 06, 2011 Jul 06, 2011
LATEST
Does this mean that google is searching the text within the image and giving it some weight? My alternate guess is that google is simply mirroring the text from my site once it has already ranked the page. But still, this mirroring is converting image to text because those sentences are not writte anywhere else.

That's a negatoro, friend. Google cache for your page says that the page was indexed on the 4th. More info on Google cache available here.

Comparison of Google's cache vs. your current page differs. You changed the page since then and Google has not re-indexed it yet. If you look at the Google cache you will see the sentences were written in the Apartment searching tab (on the right side of your menubar) before you made changes to the page and converted allllll the valuable text into an image (and moved the Apartment searching tab to the left side of your menubar). Does this ring a bell? When your page does get re-indexed by Google it will take a hit in page ranking because of the absent text. Nice try with your theory though. Unfortunately you can not fool me, or Google for that matter.

With respect, this is a php script redirect thread, not a Google ranks my page even though it's an image thread. Additional questions regarding Google placement should be posted in a new thread, preferably on Google's forum.

best,

Shocker

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 06, 2011 Jul 06, 2011

It's working for me. When I submit, it redirects back to your homepage.

Also, heed what shocker has said about your page design. Making the main content of your homepage out of images is a very bad practice. It's bad for both search engines and visitors.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines