Solved

Php page not expanding

Posted on 2006-11-29
2
170 Views
Last Modified: 2006-12-02
Hi,

If you go to this address:

http://www.toubes-page.net/td/yhteystiedot/index.php?id=content&page=tarjouspyynto

and try to send the the form leaving all fields empty you get to a page which says what column you left empty.

Ok, the form and the error check works fine.. but the thing that doesn't work is the page expanding when an error message is displayed, if all fields are filled correctly the success expands the page as it should.

here's the code for the page:

<span class="linkit" style="margin-left: 38px; font-size: 11px; font-weight: bold;"><a href="../yhteystiedot">Yhteystiedot</a> / <a href="index.php?id=content&page=tarjouspyynto">Tarjouspyyntö</a> / Kiitos</span>
</div>
<div id="inner_bg"><br/>
<div style="margin-left: 40px; margin-right: 20px;">

<?php

  if (empty($name))
     {
            echo "<span style=\"font-weight: bold;\">Nimikenttä on tyhjä, palaa takaisin</span><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br class=\"clear\" /><br/>";
             exit;
     }

 if (empty($email))
     {
          echo "<span style=\"font-weight: bold;\">Sähköpostikenttä on tyhjä, palaa takaisin</span><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>"; ---> when a field is left empty this message is displayed and the page is not expnded as it should be.


              exit;
     }

$good = ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.
               '@'.
               '[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.
               '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$',
               $email);
     if (!$good)
     {
          echo "<span style=\"font-weight: bold;\">Sähköpostikentässä virheellisiä kirjaimia, palaa takaisin</span><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>";
          exit;
     }


 if (empty($nro))
     {
          print "<p style=\"font-weight: bold;\">Puhelinnumerokenttä on tyhjä, palaa takaisin</p><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>";

          exit;
     }

$name=$_POST['name'];
$email=$_POST['email'];
$nro=$_POST['nro'];
$internetsivut=$_POST['Internetsivut'];
$pc=$_POST['pc'];
$it=$_POST['IT'];
$message=$_POST['message'];
$to="tobias.fransman@taloverkot.fi";
$message="$name jätti tarjouspyynnön.\n \nE-mail: $email\n \nPuhnro: $nro\n\nKiinnostusalueet:\n$internetsivut\n$pc\n$it\n \n
Viesti: $message";

if(mail($to,"Toubes Design Tarjouspyyntö",$message,"From: $email\n"))
{
      echo "Kiitos Tarjouspyynnöstänne, otamme teihin mahdollisimman pian yhteyttä"; ---> when success this text is displayed and the page is fully expanded
}

else
{
      echo "Syntyi virhe lähetyksessä, yritä uudelleen.";
}
?>

<br class="clear" />
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>

Any clues why the expanding is not working on the  if (empty($name)) elements but works on the success element?

Thanks,

-Toby
0
Comment
Question by:Toube
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
bobbyo earned 300 total points
ID: 18044466
Hi,

I seem to be getting the same result if I leave all fields blank or if I complete them?
0
 

Author Comment

by:Toube
ID: 18044842
Hi, if you complete them you should get a message saying 'Kiitos Tarjouspyynnöstänne, otamme teihin mahdollisimman pian yhteyttä' and then the page looks just like it should look like.. background streched and so on.

-Toby
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question