Search the Community
Showing results for tags 'not working'.
-
Hello i am trying to make the admin login in a webpage and after I completed the page i uploaded it and now the page is not loading Here is the script <?php error_reporting(E_ALL); ini_set('display_errors', '1'); exit(); ?> <?php session_start(); if (!isset($_SESSION["manager"])){ header("location:admin_login.php"); exit(); } exit(); ?> <?php if(isset($_POST["username"])&&isset($_POST["password"])){ $manager=preg_replace('#[^A-Za-z0-9]#i','',$_POST["username"]); $password=preg_replace('#[^A-Za-z0-9]#i','',$_POST["password"]); include"../storescripts/connect_to_mysql.php"; $sql=mysql_querey("SELECT id FROM admin WHERE username='$manager' AND password='$password' LIMIT 1"); if($existCount == 1){ while($row = mysql_fetch_array($sql)){ $id = $rpw["id"]; } $_SESSION["id"] = $id; $_SESSION["manager"] = $manager; $_SESSION["password"] = $password; header("location:index.php"); exit(); } else { echo 'That Information is incorrect, try again <a href="index.php">Click Here</a>'; exit(); } } ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Admin Login</title> <link rel="stylesheet" href="k../style/style.css" type="text/css" media=="screen" /> <script type="text/javascript" src="//use.typekit.net/jxp6vds.js"></script> <script type="text/javascript">try{Typekit.load();}catch(e){}</script> </head> <body> <div align="centre" id="mainWrapper"> <?php include_once("../template_header.php") ?> <div id="pageConntent"> <h2>Please Log In To Manage The store</h2> <form id="form1" name="form1" meathod="post" action="admin_login.php"> Username:<br/> <input name="username" type="text" id="username" size="40"/> <br/><br/> Password<br/> <input name="password" type="password" id="password" size="40"/> <br/> <br/> <br/> <input type="submit" name="button" id="button" value="Log In" /> </form> </div> <?php include_once("../footer.php"); ?> </div> </body> </html> Thank you in advance
-
Hello, I am writing an app and I am trying to include a feedback form. I have the form and php script written but it isn't working. Can somebody take a look at it and see if I am missing something? This is my first try at writing PHP. The form will submit via email and have five sections: name, email, city, what and comments. Submit to List Name: Email: City: What: Comments: The form shows up fine but it is the PHP I'm having trouble with. Below is the code I have so far for the HTML form and PHP file. I would like an email of the form to go to tim@akluk.com and another screen to pop up that says "Thank You" with a close button to take the viewer back to the home page. I appreciate any help I can get on getting this form to work. I am currently using Dreamweaver as my editor and I modified some code I found here: http://www.freecontactform.com/email_form.php. I am also referencing an O'Reilly book called Learning PHP, MySQL, JavaScript, & CSS. Thanks for your help! submit.htmlsubmit.php // Form HTML // "submit.html" <!DOCTYPE HTML> <html> <head> <meta charset="UTF-8"> <title>Submit to List</title> <meta name="viewport" content="width=device-width,user-scalable=no"> <link rel="stylesheet" href="jquery.mobile-1.0.css" /> <link href="jQueryAssets/jquery.ui.core.min.css" rel="stylesheet" type="text/css"> <link href="jQueryAssets/jquery.ui.theme.min.css" rel="stylesheet" type="text/css"> <link href="jQueryAssets/jquery.ui.button.min.css" rel="stylesheet" type="text/css"> <script src="jquery.js"></script> <script src="script.js"></script> <script src="jquery.mobile-1.0.js"></script> <script src="jQueryAssets/jquery-1.8.3.min.js" type="text/javascript"></script> <script src="jQueryAssets/jquery-ui-1.9.2.button.custom.min.js" type="text/javascript"></script> </head> <body> <div data-role="dialog"> <div data-role="header"> <h1>Submit to List</h1> </div> <div data-role="content"> <form action="submit.php" method="post" data-transition="none"> <div data-role="fieldcontain"> <label for="name">Name:</label> <input type="text" name="name" id="name" value="" required /> </div> <div data-role="fieldcontain"> <label for="email">Email:</label> <input type="email" name="email" id="email" value="" required /> </div> <div data-role="fieldcontain"> <label for="City">City:</label> <input type="text" name="city" id="city" value="" required /> </div> <div data-role="fieldcontain"> <label for="what">What:</label> <input type="text" name="what" id="what" value="" required /> </div> <div data-role="fieldcontain"> <label for="comments">Comments:</label> <textarea cols="40" rows="8" name="comments" id="comments"></textarea> </div> <input type="submit" value="Send" data-theme="a"> </form> </div> </div> </body> </html> // PHP Code // "submit.php" <!DOCTYPE HTML> <html> <head> <meta charset="UTF-8"> <title>Submission</title> <meta name="viewport" content="width=device-width,user-scalable=no"> <link rel="stylesheet" href="jquery.mobile-1.0.css" /> <script src="jquery.js"></script> <script src="script.js"></script> <script src="jquery.mobile-1.0.js"></script> </head> <body> <div data-role="dialog"> <div data-role="header"> <h1>Submit to List</h1> </div> <div data-role="content"> <?php if(isset($_POST['email'])) { // EDIT THE 2 LINES BELOW AS REQUIRED $email_to = "tim@akluk.com"; $email_subject = "List Suggestion"; function died($error) { // your error code can go here echo "We are very sorry, but there were error(s) found with the form you submitted. "; echo "These errors appear below.<br /><br />"; echo $error."<br /><br />"; echo "Please go back and fix these errors.<br /><br />"; die(); } // validation expected data exists if(!isset($_POST['name']) || !isset($_POST['email']) || !isset($_POST['city']) || !isset($_POST['what']) || !isset($_POST['comments'])) { died('We are sorry, but there appears to be a problem with the form you submitted.'); } $name = $_POST['name']; // required $email_from = $_POST['email']; // required $city = $_POST['city']; // required $what = $_POST['what']; // required $comments = $_POST['comments']; // required $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; if(!preg_match($email_exp,$email_from)) { $error_message .= 'The Email Address you entered does not appear to be valid.<br />'; } $string_exp = "/^[A-Za-z .'-]+$/"; if(!preg_match($string_exp,$name)) { $error_message .= 'The Name you entered does not appear to be valid.<br />'; } $string_exp = "/^[A-Za-z .'-]+$/"; if(!preg_match($string_exp,$city)) { $error_message .= 'The City you entered does not appear to be valid.<br />'; } $string_exp = "/^[A-Za-z .'-]+$/"; if(!preg_match($string_exp,$what)) { $error_message .= 'What you entered does not appear to be valid.<br />'; } if(strlen($comments) < 2) { $error_message .= 'The Comments you entered do not appear to be valid.<br />'; } if(strlen($error_message) > 0) { died($error_message); } $email_message = "Form details below.\n\n"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "Name: ".clean_string($name)."\n"; $email_message .= "Email: ".clean_string($email_from)."\n"; $email_message .= "City: ".clean_string($city)."\n"; $email_message .= "What: ".clean_string($what)."\n"; $email_message .= "Comments: ".clean_string($comments)."\n"; // create email headers $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email_from."\r\n". 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); ?> Thanks for your suggestion. <a data-role="button" data-inverse="true" href="index.html">Close</a> </div> </div> </body> </html>
-
I am stuck at this code I am using the jquery to load a entire id which works ok without live but for some reason I need to add live, But after using it the whole document buttons fail to work please help with this. $(document).ready(function(){ $("#td3 a").live("click",function(e){ var id=$(e.target).text(); $("#td1").load("pending_approvals.php #td1",{page:id}); }); }); <tr> <td id="td3"> Enter View Limit:<input type="text" name="limit" /> Pages>> <?php for ($i = 1; $i <= $total_pages; $i++) { echo "<a href='#'>$i</a> "; } ?> </td> </tr>
-
Hello! I have a script on a website that is supposed to email users messages/alerts, and it was working fine on PHP 5.2, but doesn't work on PHP 5.4. It doesn't include any of the $variables in the email it sends. Any ideas? The webpage shows correctly, says it was sent, and sends a mostly blank email. (This is not all the code, but the important workings of it.) Is there something I need to reference differently for 5.4? Any solutions would be greatly appreciated! <?php if (isset($acode) && $acode != 'unset') { echo"<div style=\"font-size: 110%\">Send an Alert for:<br /><b> $location > $dept > $alert</b> <br /><br /> </div> <form name=\"alert\" onsubmit=\"return isReady(this)\" action=\"$formaction\" method=\"POST\"> <input type=\"hidden\" name=\"Location\" value=\"$location\"> <input type=\"hidden\" name=\"Department\" value=\"$dept\"> <input type=\"hidden\" name=\"Code\" value=\"$acode\"> <input type=\"hidden\" name=\"Alert\" value=\"$alert\"> <input type=\"hidden\" name=\"Contacts\" value=\"$tocode\"> Your name: <br /> <input type=\"text\" name=\"Name\" size=\"40\" maxlength=\"70\" value=\" Required\" onfocus=\"if(this.value==' Required')this.value='';\" onblur=\"if(this.value=='')this.value=' Required';\"><br /> <br /> Your e-mail address: <br /> <input type=\"text\" name=\"Email\" size=\"40\" maxlength=\"90\" value=\" Required\" onfocus=\"if(this.value==' Required')this.value='';\" onblur=\"if(this.value=='')this.value=' Required';\"><br /> <br /> Brief message: <span style=\"color: #666666; font-size: 70%\"> Please keep in point form if possible. </span> <br /> <textarea name=\"Message\" cols=\"65\" rows=\"7\" maxlength=\"5000\"> </textarea> <span class=\"smbr\"> <br /> <br /> </span> <br /> <div style=\"color: #666666; font-size: 70%; text-indent: 50px\"> All fields required. Include date & time of occurance if applicable. </div><br /> <input type=\"hidden\" name=\"Date\" value=\"$date\"> <input type=\"hidden\" name=\"action\" value=\"submitted\"> <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td align=\"center\" width=\"25%\"> <input type=\"submit\" name=\"SUBMIT\" id=\"mySender\" value=\"Send...\" onclick=\"return monitor()\" style=\"margin: 0px 0px 0px 10px\"> </td> <td align=\"left\" width=\"75%\" style=\"color: #666666; font-size: 70%\"> Please wait a moment after pressing send. If you do not get a confirmation message<br /> after 10 seconds, please press F5 to refresh the page and try again. </td> </tr> <tr> <td align=\"left\" colspan=\"2\" style=\"color: #666666; font-size: 70%\"> <br /><br /> <b>Your alert will be sent to the following people:</b><br /> $who </td> </tr> </table> </form><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />"; } else { print " <form> <div style=\"color: #999999; font-size: 120%\" align=\"center\"> Please select a location and the type of alert. </div> </form> "; } ?> <?php if (isset($_POST['action']) && $_POST['action'] == 'submitted') { // find multiple correct recipients based on the proper code $tocode = $HTTP_POST_VARS["Contacts"]; // convert variables from reference file, find values - email address string separated by commas $tocontacts = $$tocode; $to = $tocontacts; $alert = $HTTP_POST_VARS["Alert"]; $email = $HTTP_POST_VARS["Email"]; $name = $HTTP_POST_VARS["Name"]; $location = $HTTP_POST_VARS["Location"]; $department = $HTTP_POST_VARS["Department"]; $subject = "ALERT - $alert"; $details1 = $HTTP_POST_VARS["Message"]; $details2 = str_replace("\n", "<br />", $details1); $details3 = stripslashes($details2); // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "From: $email\r\n"; // account for alerts archive $headers .= 'Cc: ealerts@email.com' . "\r\n"; // BCC of all alerts // $headers .= 'Bcc: bcc@email.com' . "\r\n"; $messagetop = '<html><head><title>Alert</title></head><body style="font-family: Arial, sans-serif"><br><font size="+2" color="#006600"><b>ALERT</b></font><br /><table style="font-family: Arial, sans-serif">'; $messagemid .= '<tr><td colspan="2"><hr style="color: #004400" /></td></tr><tr><td colspan="2"><b>'; $messagemid .= $location; $messagemid .= ' > '; $messagemid .= $department; $messagemid .= ' > '; $messagemid .= $alert; $messagemid .= '</b></td></tr>'; $messagemid .= '<tr><td colspan="2"><hr style="color: #004400" /></td></tr><tr><td><b>Message:</b></td><td>'; $messagemid .= $details3; $messagemid .= '<br /></td></tr>'; $messagemid .= '<tr><td colspan="2"><hr style="color: #004400" /></td></tr><tr><td><b>Name:</b></td><td>'; $messagemid .= $name; $messagemid .= '<br /></td></tr>'; $messagemid .= '<tr><td colspan="2"><hr style="color: #004400" /></td></tr><tr><td><b>Email:</b></td><td>'; $messagemid .= $email; $messagemid .= '<br /></td></tr>'; $messageend = '</table><br /><br /><br /><font size="-1" color="#004400"><b>Sample</b></font><br /></body></html>'; $message = $messagetop . $messagemid . $messageend; //--------------- Assemble Auto Response ----------- $resmessagethanks = '<tr><td colspan="2">Thank you for sending an Alert!<br /><br />The following is for your reference:<br /><br /></td></tr>'; $resmessageend = '</table><br /><br /><br /><font size="-1" color="#004400"><b>Please note: Replying to this automated message will not reach anyone else.</b> </font><br /></body></html>'; $responsesubject = "Your Alert - $alert"; $responseheaders = 'MIME-Version: 1.0' . "\r\n"; $responseheaders .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $responseheaders .= "From: $email\r\n"; $autoresponse = "$messagetop . $resmessagethanks . $messagemid . $resmessageend"; //--------------- Actual Form send ----------- if (@mail($to, $subject, $message, $headers)) { print "<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><a name=\"finished\"></a><br /><br /> <div align=\"center\"> <span style=\"color: #009900; font-size: 150%\">Alert has been sent!</span> </div><br /><br /><br /> "; //--------------- Send Auto Response ----------- mail($email, $responsesubject, $autoresponse, $responseheaders); } else { print "<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></a><br /><br /><br /><br /><br /><br /><br /><a name=\"finished\"><br /><br /> <div style=\"color: #990000; font-size: 150%\" align=\"center\"> Sorry, sending alert failed.<br /> </div> "; } } else { } ?>
-
Hello All, I am having some trouble with my mobile stylesheets. They aren't loading when I look at my site on mobile devices. This is what I have now. <link rel="stylesheet" type="text/css" href="../css/master.css" media="screen"/> <link rel="stylesheet" type="text/css" href="../css/article.css" media="screen"/> <link rel="stylesheet" type="text/css" href="../css/mod.css" media="screen"/> <link rel="stylesheet" href="../css/mobile.css" media="only screen and (max-device width:480px)"/> The mobile stylesheet pretty much says to hide the right floating column and give the content a 100% width and the wrapper a 90% width. I am not really familiar with @media or @import. What do I need to do??
- 3 replies
-
- mobile
- not working
-
(and 2 more)
Tagged with:
-
http://independentrepublicofursum.tk/Become_a_Citizen/ is the page I am having trouble on. Basically what I want to happen here is for the user to download a fillable pdf application, fill it, and upload it. From there the php script will send it to my email so I can review it. My code is... function mail_file($to, $from, $subject, $body, $file) { $boundary = md5(rand()); $header = array( "MIME-Version: 1.0", "Content-Type: multipart/mixed; boundary=\"{$boundary}\"", "From: {$from}" ); $message = array( "--{$boundary}", "Content-Type: text/plain", "Content-Transfer-Encoding: 7bit", '', chunk_split($body), "--{$Boundary}", "Content-Type: {$file['type']}; name=\"{$file['name']}\"", "Content-Disposition: attachment; filename=\"{$file['name']}\"", "Content-Transfer-Encoding: base64", '', chunk_split(base64_encode(file_get_contents($file['tmp_name']))), "--{$boundary}--" ); mail($to, $subject, implode("\r\n", $message), implode("\r\n", $headers)); } Then to send it I use... if (isset($_FILES['file'])) { mail_file('myemail@gmail.com', 'ContactUs@independentrepublicofursum.tk', 'test subject', '', $_FILES['file']); } My form is... <form name="citizenship_application" action="" method="post" enctype="multipart/form-data"> First Name: <input type="text" name="first_name" value="<?php echo $first_name_value; ?>"> <br /> <br /> Last Name: <input type="text" name="last_name" value="<?php echo $last_name_value; ?>"> <br /> <br /> E-Mail:       <input type="text" name="e_mail" value="<?php echo $e_mail_value; ?>"> <br /> <br /> Gender:       <input type="radio" name="sex" value="male" <?php echo $male_pre_select; ?> >Male <input type="radio" name="sex" value="female" <?php echo $female_pre_select; ?> >Female <br /> <br /> <label for="file">Please specify your application file:</label> <br /> <input type="hidden" name="MAX_FILE_SIZE" value="501"> <input type="file" name="file" size="50"> <br /> <br /> <input type="submit" value="Submit Application" name="submit">  <?php echo $error; ?> </form> I get two errors, the first one is... Warning: file_get_contents() [function.file-get-contents]: Filename cannot be empty in /home/u418744221/public_html/Become_a_Citizen/index.php on line 38 Line 38 is... chunk_split(base64_encode(file_get_contents($file['tmp_name']))), My second error is... Warning: implode() [function.implode]: Invalid arguments passed in /home/u418744221/public_html/Become_a_Citizen/index.php on line 43 line 43 is... mail($to, $subject, implode("\r\n", $message), implode("\r\n", $headers)); Really need this finished, ASAP. I can't figure it out, any help appreciated thanks ya'll.
- 1 reply
-
- attachment
-
(and 3 more)
Tagged with: