Solved

Php page not expanding

Posted on 2006-11-29
2
168 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
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This article discusses four methods for overlaying images in a container on a web page
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

821 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