Jump to content

PadLock

New Members
  • Posts

    9
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

PadLock's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi. First post here. I am currently developing an application for a client. We elected to go with Symfony 3 and PHP 7 for the build to give it a longer lifespan. I am currently working with session management and it appears that for some reason Symfony is auto starting the session. I am entirely unsure why it is doing this or where it is being told to. I verified that the session auto start was disabled in php.ini and I have check the YML config files for Symfony. I tested for this with the following code: $session = $this->container->get('session')->isStarted(); echo $session; exit(); It returned a value of 1. What am I missing?
  2. My hero. Thank you. I'm a bit new to PHP so I keep finding out neat little quirks like that. By neat little quirks I mean things that make me want to throw my laptop across my office. Thanks!
  3. http://www.zest4life.us/index_1.html Just make sure to leave a form blank so it will stop on the page with the display issue.
  4. Unfortunately that is not the case as .top and .bottom are both classes of #tb_margin which has the height and width already defined. Here is the code for them. #tb_margin { width:960px; height:35px; float:left; } #tb_margin.top { background-image:url(../images/Z4L_02.jpg); background-position:bottom; } #tb_margin.bottom { background-image:url(../images/Z4L_21.jpg); background-position:top; } I really wish it was something that simple but I am entirely at a loss as to why this is behaving in the manner that it is. I'm also attaching a screenshot to make it a little more clear what it is that i am talking about.
  5. As far as I know JS is the only way to do it. You might want to look into some AJAX documentation. It sounds to me like that is the sort of thing you are aiming for.
  6. I'm working on a set of three pages for a client using a combination of PHP and JS to automatically check submitted information for errors and then email it if no error is found. That part is working smoothly but now that I have come to the "making it pretty" part I am having an odd issue. The page itself has 5 divs which are surrounded on all sides by divs containing drop shadows. The drop shadow at the bottom for whatever reason is refusing to be seen but the same div is being used on another page without issue. Here is the code for the page causing the trouble at the moment. <?php setcookie("fName", $_REQUEST["firstName"], time()+3600*24, '/', '.zest4life.us'); setcookie("lName", $_REQUEST["lastName"], time()+3600*24, '/', '.zest4life.us'); setcookie("email", $_REQUEST["email"], time()+3600*24, '/', '.zest4life.us'); setcookie("Hphone", $_REQUEST["homePhone"], time()+3600*24, '/', '.zest4life.us'); setcookie("Mphone", $_REQUEST["mobilePhone"], time()+3600*24, '/', '.zest4life.us'); setcookie("contact", $_REQUEST["prefContact"], time()+3600*24, '/', '.zest4life.us'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Zest 4 Life</title> <link href="../css/index_1.css" rel="stylesheet" type="text/css" /> </head> <body> <?php $blank = ""; $fname = $_REQUEST["firstName"]; $lname = $_REQUEST["lastName"]; $email = $_REQUEST["email"]; $Hphone = $_REQUEST["homePhone"]; $Mphone = $_REQUEST["mobilePhone"]; $contact = $_REQUEST["prefContact"]; ?> <div id="wrapper"> <div id="tb_margin" class="top"></div> <div id="form_mar"></div> <div id="logo" class="Hldr"></div> <div id="logo" class="Cntr"></div> <div id="logo" class="Rt"></div> <div id="Frm" class="fr"> </div> <div id="Frm" class="fr1"> <font size="2px" color=#ff0000> <? $errorCount = 0; /*Check for blank fields */ if($fname == $blank){ echo nl2br("Please enter your first name.\n"); $errorCount += 1; } if($lname == $blank){ echo nl2br("Please enter your last name.\n"); $errorCount += 1; } if($email == $blank){ echo nl2br("Please enter your email address.\n"); $errorCount += 1; } if($Hphone == $blank){ echo nl2br("Please enter your home phone number.\n"); $errorCount += 1; } if($Mphone == $blank){ echo nl2br("Please enter your mobile phone number.\n"); $errorCount += 1; } if($contact == "Preferred Contact"){ echo nl2br("Please select your preferred method of contact.\n"); $errorCount += 1; } /* Validated Email Address */ if(!filter_var($email, FILTER_VALIDATE_EMAIL)){ echo nl2br("Please enter a valid email address.\n"); $errorCount += 1; } if($errorCount == 1){ echo "Please use the back button to correct the above error."; exit; } if($errorCount > 1){ echo "Please use the back button to correct the above errors."; exit; } ?> <script type="text/javascript"> var errorCount = <?= "$errorCount"?>; <!-- function sndMail(){ window.location="http://www.zest4life.us/PHP/Z4L_Snd.php"; } //--> if(errorCount == 0){ document.write("Your information is being processed. Thank you for your time."); setTimeout(sndMail,5000); } </script> </font> </div> <div id="tb_margin" class="bottom"> </div> </div> Specifically it is the <div id="tb_margin" class="bottom"> </div> that is not showing up. ideas?
  7. I fixed the problem. It seems that defining the subject or the body of the email with the variables above which consisted of other predefined variables from the cookies was the problem. The original mail() code was: mail($to, $subject, $message, $headers); What I wound up doing was: mail($to, "New Contact Information", $today.$fname.$lname.$email.$hphone.$mphone.$contact, $headers); This seems to be working. I'm not sure if it is because I am getting the variable definitions from cookies or what the issue was but this seemed to fix it. If anyone happens to know exactly what caused the issue I would love to know so I can work around it more intelligently in the future.
  8. Yes they are actual emails. The site is hosted on GoDaddy and the original form I made that just sends the email without checking for errors works so I know that emails can in fact be sent which is what puzzles me about this. I should also add that the $from email that is going in $headers is of the same domain as the website so that shouldn't be the issue either.
  9. Problem Background: The PHP code I am working with spans three pages. It starts on the first gathering information in a form. On the second it checks to make sure all fields were entered and that the data inside them is valid. On this second page these values are set to cookies and we are taken to a third page if there are no errors where the information is mailed to my client. The third page is where I am having my problems. Problem: Line 36 consists of mail($to, $subject, $message, $headers); This is the code for the third page which is getting the error in its entirety. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Untitled Document</title> </head> <body> <?php $td = date("Y-m-d"); $today = "Date :" . $td; $fname = "\n" . "First Name : " . $_COOKIE["fName"] . "\n"; $lname = "Last Name : " . $_COOKIE["lName"] . "\n"; $email = "Email : " . $_COOKIE["email"] . "\n"; $hphone = "Home Phone : " . $_COOKIE["Hphone"] . "\n"; $mphone = "Mobile Phone : " . $_COOKIE["Mphone"] . "\n"; $contact = "Preferred Contact: " . $_COOKIE["contact"] . "\n"; $to = "client email address"; $subject = "Contact Information: " . $fname . " " . $lname; $message = $today . $fname . $lname . $email . $hphone . $mphone . $contact; $from = "client info email address is here"; $headers = "From:" . $from; mail($to, $subject, $message, $headers); echo "Mail Sent."; ?> </body> </html> Any ideas?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.