tryingtolearn
Members-
Posts
293 -
Joined
-
Last visited
-
Days Won
1
Everything posted by tryingtolearn
-
Merging data from two multidimensional arrays
tryingtolearn replied to StevenTompkins's topic in PHP Coding Help
If it's coming from "scrapping" different sites couldn't you just add it to the array you want instead of adding it to its own separate array and them trying to merge? Just a thought might or might not work since I don't know the process that gets it to the point you are trying to merge.. -
Replace $calldate=$_POST['calldate']; With the code I posted But change $dbc to your variable you are using in your connection script. Then you also need to add a check in there to only execute the query if the conditions are met Like If($calldate){ Add Db query here } Sorry on my phone know so if you can try and get that to work great Or I can post more later at my computer
-
Where are you adding the validation in your code? It should be after it checks if the form is submitted but before the db query ? Maybe you could post how you have it set up now
-
Check out the difference between empty() nd isset() I like to use empty() on the text inputs and isset() on the checkboxes something like // Validate the input calldate: if (!empty($_POST['calldate'])) { $calldate = mysqli_real_escape_string ($dbc, $_POST['calldate']); } else { $calldate = FALSE; echo '<p class="error">You forgot to enter a date!</p>'; }
-
Input text string to database then print to image
tryingtolearn replied to chrisb302's topic in PHP Coding Help
Not sure what isnt working for you, I have some ideas from how things are laid out but.... Some things right off the bat, look into mysqli over mysql to stay current. you can post the form data back to itself in the (action="index.php") At the top of index.php add something like this <?php if ($_SERVER['REQUEST_METHOD'] == 'POST') { //add your form processing code here } ?> so when the submit button is pressed the above will run. next - give some names to your inputs so your form processing code knows what to do with what info. for example <input type="text" name="ukey" value="ukey"> then your form process would do something like this // Trim all the incoming data: $trimmed = array_map('trim', $_POST); // Assume invalid values: $ukey = $hb = $ig = $other = FALSE; // Validate the input Key string: if (!empty($trimmed['ukey'])) { $ukey = mysqli_real_escape_string ($dbc, $trimmed['ukey']); } else { $ukey = FALSE; echo '<p class="error">You forgot to enter a key!</p>'; }.....and so on with the rest of the form to continue with the one step process you could use http://php.net/manual/en/mysqli.insert-id.php so once the data is added to the db successfully it will pass the last ID to your image create function. As for the image with the text on it, not sure how far you got with that but you can look into the gd image functions - like ... this is a start if any of it makes sense. -
radio button value 0 in $_POST shows "on" in var_dump
tryingtolearn replied to AdRock's topic in PHP Coding Help
Doesn't seem like you should have to do that but hard to tell without seeing the class. -
radio button value 0 in $_POST shows "on" in var_dump
tryingtolearn replied to AdRock's topic in PHP Coding Help
might just be a typo but do you have a = sign for name in the real code? just a thought because this works <?php if ($_SERVER['REQUEST_METHOD'] == 'POST') { var_dump($_POST); } ?> <form action="index.php" method="POST"> <input type="radio" name="whatever" value="0"> <input type="radio" name="whatever" value="1"> <input type="radio" name="whatever" value="2"> <input type="submit" name="submitted" value="Search" /> </form> but this doesnt <?php if ($_SERVER['REQUEST_METHOD'] == 'POST') { var_dump($_POST); } ?> <form action="index.php" method="POST"> <input type="radio" name"whatever" value="0"> <input type="radio" name="whatever" value="1"> <input type="radio" name="whatever" value="2"> <input type="submit" value="Search" /> </form> -
On this line $query = "SELECT * FROM asterisk_cdr WHERE $calldate LIKE '%$calldate%' AND $channel LIKE '%$channel%'"; change $calldate LIKE '%$calldate%' AND $channel LIKE '%$channel%' to calldate LIKE '%$calldate%' AND channel LIKE '%$channel%' You want to use the database table names there NOT the variables from the form.
-
Help With 'include' statement - Can't Get Mine To Work
tryingtolearn replied to Major_Que's topic in PHP Coding Help
Your include is working fine, the problem is with your html and css code. I would start with using the html validator at http://validator.w3.org/ That should get you going in the right direction anyway.. -
Are you trying to get the value of the drop down item they select into your query? If so, I am not sure that it is going to work this way.. $aa = "author"; $bb = "publisher"; $cc = "yearpublished"; $dd = "genre"; is just going to pass the words author, publisher, yearpublished, and genre as the values - not the dropdown values Or am I missing something?
-
recently tackled the same thing, Sort of like paginating db results.. I did it by using array_chunk This got me the page #s from the parent array and the files from the child arrays Best way, not sure - but it worked - maybe it will work for you as well. //where the files are located $fileDir = 'yourDir/'; //set the file ext you want to grab jpg in this case $allFiles = glob($fileDir . '*.{jpg,jpeg}', GLOB_BRACE); //how many files to display on each page $fileDisp = 30; //create the pages how many files to show per page. //array_chunk gave me the parent array being the # of pages and the child array being the content for each page $pages = array_chunk($allFiles, $fileDisp); //determine what page we are on $currentPage = (int)$_GET['showpage']; //display the files foreach($pages[$currentPage] as $file){ echo $file.'<br />'; } //create/display pagination links //loop to create links for each page //create the Previous link $previousPage = (int)$_GET['showpage']-1; if($currentPage > 0){ echo' <a href="page.php?showpage='.$previousPage.'">Previous</a> '; } //display the numbered page links for($i=0; $i< count($pages); $i++){ echo' <a href="page.php?showpage='.$i.'">'.($i+1).'</a> '; } //create the Next link $nextPage = (int)$_GET['showpage']+1; if($currentPage < count($pages)-1){ echo' <a href="page.php?showpage='.$nextPage.'">Next</a> '; }
-
Where is anti-formatting performed?
tryingtolearn replied to NotionCommotion's topic in PHP Coding Help
yes and yes... If I use a MVC approach I tend to lean towards the controller being all of my php code and I use stored procedures to move the model functions into the database. But it really depends on the site design and like I said the size of the project. Is there a need to keep the sections separate? is it personal preference etc... Honestly the only time I find it "useful" is when there are teams of people working on the development (Designers, coders, think tank idea people) MVC kinda keeps order to the progress and updates of the site. I actually prefer having things combined and comment the heck out of the page as I go along writing it I mean the section of the site where administrators can take care of a site, user management, content posting, tracking, etc... -
Where is anti-formatting performed?
tryingtolearn replied to NotionCommotion's topic in PHP Coding Help
Short answer - Controller Model = access data View = presentation layer Controller = logic that reacts to user activity. long answer - its not really the reverse, You are still accessing data presenting it and having to react to user activity even if its on the admin side or updating rather than simply displaying. MVC is just a design pattern but it can easily become overwhelming especially when designing small scale sites or sites where only 1 or 2 people are involved in the development. Simply because of following the logic and having multiple files to perform simple tasks (Thats just my opinion) -
Not sure if I still understand what you mean, Im guessing you want the image and the echoed session to be the same.. if so, Try moving $string = ''; for ($i = 0; $i < 5; $i++) { $string .= chr(rand(97, 122)); } $_SESSION['captcha'] = $string; from your captcha creation page and put it above your form..
-
Not exactly sure I understand what the problem is from this. Do you mean it doesn't display in the form??
-
If prio_color isnt inserting then it means it doesn't have that index you are establishing with your loop. so you have to either get the array to have that index or change the way you are inserting it. Hard to come up with a solution not knowing what you are trying to accomplish or how you are getting to this point. Are you just simply trying to add the form results to the DB or something different.
-
say for example your arrays were as follows $from_branch = array(1,2,3); $to_branch = array(1,2,3,4); $quantity = array(1,2,3,4,5); $prio_color = array(1,2,3,4,5,6); then with your loop $i would be 6 but none of your arrays would have an index of 6 hence the undefined offset.
-
The undefined offset means you are referring to an array key that doesn't exist. So one or more of the following are not in your array $from_branch[$i] $to_branch[$i] $quantity[$i] $prio_color[$i]
-
Need help with PHP form to email script
tryingtolearn replied to newatthis123's topic in PHP Coding Help
Well kudos for sticking with it. Here is what I did First went through and made all the html form field names and the .php $_POST names and variables match. Then addressed the validation part We have to test if a variable has a value, if you call a variable and it doesn't have a value you will get undefined index errors (Probably why you weren't getting emails) I used two different php functions for this isset() and empty() Read those pages for the difference between the two. I use empty() on the text inputs and isset() on the checkboxes For example: // get name if(!empty($_POST['Name'])){ $Name = htmlentities($_POST['Name']); }else{ $Name = "They didnt enter a name"; } this is saying if the name field of the form is NOT empty (The ! is for the not) the whatever they typed in that form field is now assigned to the variable $Name else (Meaning that form field was blank) - The string "They didnt enter a name is assigned to the variable $Name either way $Name now has a value to it so you wont get any undefined errors when you use it later on in your script. Next - I added some security to your form because you shouldn't trust any data entered in your form because bad things can happen. Read about form security to get all kinds of examples. In your form I just added htmlentities() to all of the text input fields as you can see in the above example. I urge you to read up on that topic and create a security level you feel comfortable with using... With all that said, the forms should be working for you now. but when I tested it, I found the form a bit difficult to use. If you miss a step that you require but its on a different tab you dont know what you missed unless you click on that tab again. Thats just fyi because all items on your page should guide the user, not require them to figure things out. Just my 2 cents... Hope this helps you out. And if you are interested in learning more Ill suggest any of the books written by Larry Ullman or check out his site. Great info all around there... contact_script.php <!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>Contact Form</title> </head> <body> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <?php ini_set("display_errors", "1"); error_reporting(-1); if($_POST['Submit'] == "Submit") { // get name if(!empty($_POST['Name'])){ $Name = htmlentities($_POST['Name']); }else{ $Name = "They didnt enter a name"; } // get address if(!empty($_POST['Address'])){ $Address = htmlentities($_POST['Address']); }else{ $Address = "They didnt enter an address"; } // get phone_number if(!empty($_POST['Phone_number'])){ $Phone_number = htmlentities($_POST['Phone_number']); }else{ $Phone_number = "They didnt enter a phone number"; } // get cell_number if(!empty($_POST['Cell_number'])){ $Cell_number = htmlentities($_POST['Cell_number']); }else{ $Cell_number = "They didnt enter a cell number"; } // get email_address if(!empty($_POST['Email'])){ $Email = htmlentities($_POST['Email']); }else{ $Email = "They didnt enter an email"; } // get event_date if(!empty($_POST['Event_date'])){ $Event_date = htmlentities($_POST['Event_date']); }else{ $Event_date = "They didnt enter an event date"; } // get event_time if(!empty($_POST['Event_time'])){ $Event_time = htmlentities($_POST['Event_time']); }else{ $Event_time = "They didnt enter an event time"; } // get attendance if(!empty($_POST['Attendance'])){ $Attendance = htmlentities($_POST['Attendance']); }else{ $Attendance = "They didnt enter an attendance"; } // get banquet_room if(!isset($_POST['banquet'])){ $banquet = "n/a"; }else{ $banquet = $_POST['banquet']; } // get both_rooms if(!isset($_POST['both'])){ $both = "n/a"; }else{ $both = $_POST['both']; } // get bar_area if(!isset($_POST['bar'])){ $bar = "n/a"; }else{ $bar = $_POST['bar']; } // get contact_name if(!empty($_POST['Contact_name'])){ $Contact_name = htmlentities($_POST['Contact_name']); }else{ $Contact_name = "They didnt enter a contact name"; } // get phone_number if(!empty($_POST['Phone_number'])){ $Phone_number = htmlentities($_POST['Phone_number']); }else{ $Phone_number = "They didnt enter a phone number"; } // get phone_number if(!empty($_POST['Cell_number'])){ $Cell_number = htmlentities($_POST['Cell_number']); }else{ $Cell_number = "They didnt enter a cell number"; } // get dvd if(!isset($_POST['DVD'])){ $DVD = "n/a"; }else{ $DVD = $_POST['DVD']; } // get vhs if(!isset($_POST['VHS'])){ $VHS = "n/a"; }else{ $VHS = $_POST['VHS']; } // get built-in_screen if(!isset($_POST['built_in_screen'])){ $built_in_screen = "n/a"; }else{ $built_in_screen = $_POST['built_in_screen']; } // get built-in_projector if(!isset($_POST['built_in_projector'])){ $built_in_projector = "n/a"; }else{ $built_in_projector = $_POST['built_in_projector']; } // get cable_tv if(!isset($_POST['cable_TV'])){ $cable_TV = "n/a"; }else{ $cable_TV = $_POST['cable_TV']; } // get comcast_digital_radio if(!isset($_POST['Comcast_digital_radio'])){ $Comcast_digital_radio = "n/a"; }else{ $Comcast_digital_radio = $_POST['Comcast_digital_radio']; } // get wireless_internet if(!isset($_POST['wireless_internet'])){ $wireless_internet = "n/a"; }else{ $wireless_internet = $_POST['wireless_internet']; } // get wireless_mic if(!isset($_POST['wireless_mic'])){ $wireless_mic = "n/a"; }else{ $wireless_mic = $_POST['wireless_mic']; } // get laptop if(!isset($_POST['laptop'])){ $laptop = "n/a"; }else{ $laptop = $_POST['laptop']; } // get podium if(!isset($_POST['podium_w_mic'])){ $podium_w_mic = "n/a"; }else{ $podium_w_mic = $_POST['podium_w_mic']; } // get white_board if(!isset($_POST['white_board'])){ $white_board = "n/a"; }else{ $white_board = $_POST['white_board']; } // get keyboard if(!isset($_POST['keyboard'])){ $keyboard = "n/a"; }else{ $keyboard = $_POST['keyboard']; } // get stage if(!isset($_POST['stage'])){ $stage = "n/a"; }else{ $stage = $_POST['stage']; } // get dance_floor if(!isset($_POST['dance_floor'])){ $dance_floor = "n/a"; }else{ $dance_floor = $_POST['dance_floor']; } // get questions if(!empty($_POST['Contact_name'])){ $Questions_or_comments = htmlentities($_POST['Questions_or_comments']); }else{ $Questions_or_comments = "They didnt enter a any questions or comments"; } // get i_understand if(!isset($_POST['Agreement'])){ $Agreement = "n/a"; }else{ $Agreement = $_POST['Agreement']; } //$message = $_POST['message']; //build message prior to send mail $message = "Drake Centre Event Form.\n\n"; $message .= "Name: $Name\n\n"; $message .= "Address: $Address\n\n"; $message .= "Phone_number: $Phone_number\n\n"; $message .= "Cell_number: $Cell_number\n\n"; $message .= "Email: $Email\n\n"; $message .= "Event_date: $Event_date\n\n"; $message .= "Event_time: $Event_time\n\n"; $message .= "Attendance: $Attendance\n\n"; $message .= "banquet: $banquet\n\n"; $message .= "both: $both\n\n"; $message .= "bar: $bar\n\n"; $message .= "Contact_name: $Contact_name\n\n"; $message .= "Phone_number: $Phone_number\n\n"; $message .= "DVD: $DVD\n\n"; $message .= "VHS: $VHS\n\n"; $message .= "built-in_screen: $built_in_screen\n\n"; $message .= "built-in_projector: $built_in_projector\n\n"; $message .= "cable_TV: $cable_TV\n\n"; $message .= "Comcast_digital_radio: $Comcast_digital_radio\n\n"; $message .= "wireless_internet: $wireless_internet\n\n"; $message .= "wireless_mic: $wireless_mic\n\n"; $message .= "laptop: $laptop\n\n"; $message .= "podium_w/mic: $podium_w_mic\n\n"; $message .= "white_board: $white_board\n\n"; $message .= "keyboard: $keyboard\n\n"; $message .= "stage: $stage\n\n"; $message .= "dance_floor: $dance_floor\n\n"; $message .= "Questions or comments?: $Questions_or_comments\n\n"; $message .= "Agreement: $Agreement\n\n"; //$email_from = '[email protected]'; $email_from = '[email protected]'; $email_subject = "Drake Centre Event Form"; $email_body = "You have received a new message from the user $Name.\n". "Here is the message:\n $message". //$visitor_email = $_POST['email']; // sending email $email_to = "[email protected]"; $headers = "From: $email_from \r\n"; $headers .= "Reply-To: $Email \r\n"; //sends an email message to the address contained in $to, with the subject line contained in $email_subject, and the message contents is whatever is in the variable $email_body //mail($to,$email_subject,$email_body,$headers); //mail($to,$email_subject,$message,$headers); @mail($email_to, $email_subject, $email_body, $headers); } ?> </body> </html> index.php <!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" /> <meta name="generator" content="Adobe GoLive" /> <link href="drake_d.ico" rel="shortcut icon" /> <title>Drake Centre Contact</title> <link href="http://www.drakecentre.com/css/basic.css" rel="stylesheet" type="text/css" media="all" /> <csscriptdict import="import"> <script type="text/javascript" src="http://www.drakecentre.com/GeneratedItems/CSScriptLib.js"></script> <script src="http://www.drakecentre.com/SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script> <script src="http://www.drakecentre.com/SpryAssets/SpryValidationTextField.js" type="text/javascript"></script> <script src="http://www.drakecentre.com/SpryAssets/SpryValidationCheckbox.js" type="text/javascript"></script> </csscriptdict> <csactiondict> <script type="text/javascript"><!-- var preloadFlag = false; function preloadImages() { if (document.images) { pre_home_ro = newImage('http://www.drakecentre.com/images/navigation/home_ro.gif'); pre_contact_ro = newImage('http://www.drakecentre.com/images/navigation/contact_ro.gif'); pre_location_ro = newImage('http://www.drakecentre.com/images/navigation/location_ro.gif'); pre_menu_ro = newImage('http://www.drakecentre.com/images/navigation/menu_ro.gif'); pre_accommodations_ro = newImage('http://www.drakecentre.com/images/navigation/accommodations_ro.gif'); preloadFlag = true; } } // --></script> </csactiondict> <csimport user="navigation_comp.html" occur="23"> <csactions> <csaction name="3dc7ce6f0" class="Goto Link" type="onevent" val0="accommodations.html" val1="" urlparams="1"></csaction> <csaction name="3dc819ef1" class="Goto Link" type="onevent" val0="menu.html" val1="" urlparams="1"></csaction> <csaction name="3dc8a3e02" class="Goto Link" type="onevent" val0="location.html" val1="" urlparams="1"></csaction> <csaction name="3dc934a63" class="Goto Link" type="onevent" val0="contact.html" val1="" urlparams="1"></csaction> <csaction name="5cef216b1" class="Goto Link" type="onevent" val0="index.html" val1="" urlparams="1"></csaction> </csactions> <csactiondict> <script type="text/javascript"><!-- CSAct[/*CMP*/ '3dc7ce6f0'] = new Array(CSGotoLink,/*URL*/ 'accommodations.html',''); CSAct[/*CMP*/ '3dc819ef1'] = new Array(CSGotoLink,/*URL*/ 'menu.html',''); CSAct[/*CMP*/ '3dc8a3e02'] = new Array(CSGotoLink,/*URL*/ 'location.html',''); CSAct[/*CMP*/ '3dc934a63'] = new Array(CSGotoLink,/*URL*/ 'contact.html',''); CSAct[/*CMP*/ '5cef216b1'] = new Array(CSGotoLink,/*URL*/ 'index.html',''); // --></script> </csactiondict> </csimport> <style type="text/css"> <!-- body { margin-top: 5px; } --> </style> <link href="http://www.drakecentre.com/SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" /> <link href="http://www.drakecentre.com/SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" /> <link href="http://www.drakecentre.com/SpryAssets/SpryValidationCheckbox.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- #apDiv1 { position:absolute; left:291px; top:254px; width:388px; height:14px; z-index:7; visibility: visible; } #apDiv1 strong { font-family: Arial, Helvetica, sans-serif; } #apDiv2 { position:absolute; width:242px; height:251px; z-index:6; left: 17px; top: 263px; } #apDiv2 { font-family: Arial, Helvetica, sans-serif; } #apDiv2 { font-size: 12px; } --> </style> </head> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="MM_preloadImages('../images/navigation/home_h.gif','../images/navigation/accommodations_h.gif','../images/navigation/testimonials_h.gif','../images/navigation/location_h.gif','../images/navigation/contact_h.gif',)"> <div style="position:relative;width:740px;height:580px;background-color:#000;margin:auto;-adbe-g:p,5,5;"> <div style="position:absolute;top:1px;left:1px;width:738px;height:578px;"> <div style="position:relative;width:738px;height:578px;background-color:#fff;-adbe-g:p,5,5;"> <div style="position:absolute; top:4px; left:4px; width:730px; height:246px; visibility: visible;"> <div style="position:absolute;top:270px;left:20px;width:255px;height:150px;-adbe-c:c"> <div align="left"> <!--<font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Contact the Drake Centre today to set-up<br /> a personal tour and meeting.<br /> </font>--> </div> <div text-align="left"> <p style="margin-bottom:-12px;"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">802 West Drake Road</font></p> <p><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Fort Collins, Colorado 80526</font></p> <p><font size="6" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">970.492.6473<br /></font></p> <a href="mailto:[email protected]">[email protected]</a> </div> </div> <div style="position:absolute;top:470px;left:15px;width:139px;height:50px;"> <a href="index.html"><img src="images/drake_centre_sm.gif" alt="" border="0" /></a></div> <!-- <div id="apDiv1"><strong>Request Form </strong></div> --> <div style="position:relative;width:730px;height:246px;background-color:#000;-adbe-g:p,5,5;"> <div style="position:absolute; top:80px; left:5px; width:140px; height:140px; z-index: 1;"> <img src="images/dance_floor.gif" alt="" height="140" width="140" border="0" /></div> <div style="position:absolute; top:0px; left:7px; width:575px; height:80px; z-index: 2;"> <img src="images/contact.gif" alt="" height="80" border="0" /></div> <div style="position:absolute; top:80px; left:150px; width:140px; height:140px; z-index: 3;"> <img src="images/croud.gif" alt="" height="140" width="140" border="0" /></div> <div style="position:absolute; top:80px; left:295px; width:140px; height:140px; z-index: 4;"><img src="images/exterior.gif" alt="" height="140" width="140" border="0" /></div> <div style="position:absolute; top:80px; left:440px; width:140px; height:140px; z-index: 5;"><img src="images/interior.gif" alt="" height="140" width="140" border="0" /></div> </div> </div> <div style="position:absolute;top:531px;left:4px;width:730px;height:42px;"> <div style="position:relative;width:730px;height:42px;background-color:#000;-adbe-g:p,5,5;"><!-- #BeginLibraryItem "/Library/drake_navigation.lbi" --> <script type="text/javascript"> <!-- function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> <table border="0" align="left" cellpadding="0" cellspacing="0"> <tr> <td width="20"> </td> <td><a href="index.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Home','','images/navigation/home_h.gif',1)"><img src="images/navigation/home.gif" alt="Home" name="Home" width="54" height="40" border="0" /></a></td> <td><img src="images/navigation/line_spacer.gif" width="18" height="40" alt="line_spacer" longdesc="images/navigation/line_spacer.gif" /></td> <td><a href="accommodations.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Accommodations','','images/navigation/accommodations_h.gif',1)"><img src="images/navigation/accommodations.gif" alt="Accommodations" name="Accommodations" width="108" height="40" border="0" /></a></td> <td><img src="images/navigation/line_spacer.gif" width="18" height="40" alt="line_spacer" longdesc="images/navigation/line_spacer.gif" /></td> <td><a href="location.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Location','','images/navigation/location_h.gif',1)"><img src="images/navigation/location.gif" alt="Location" name="Location" width="54" height="40" border="0" /></a></td> <td><img src="images/navigation/line_spacer.gif" width="18" height="40" alt="line_spacer" longdesc="images/navigation/line_spacer.gif" /></td> <td><a href="contact.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Contact','','images/navigation/contact_h.gif',1)"><img src="images/navigation/contact.gif" alt="Contact" name="Contact" width="54" height="40" border="0" /></a></td> <td><img src="images/navigation/navigation_bar_01.gif" width="18" height="40" alt="line_spacer" longdesc="images/navigation/line_spacer.gif" /></td> </tr> </table> <!-- #EndLibraryItem --></div> </div> <div style="position:absolute; top:262px; left:284px; width:431px; height:90px; -adbe-c:c"> <form action="contact_script.php" method="post" enctype="multipart/form-data" name="form1" id="form1"> <div id="TabbedPanels1" class="TabbedPanels"> <ul class="TabbedPanelsTabGroup"> <li class="TabbedPanelsTab" >Contact Info</li> <li class="TabbedPanelsTab" >Event Into</li> <li class="TabbedPanelsTab" >Additional Info<br /> </li> <li class="TabbedPanelsTab" >Submit<br /> </li> </ul> <div class="TabbedPanelsContentGroup"> <div class="TabbedPanelsContent"> <p><span id="sprytextfield2"> <label>Name <input name="Name" type="text" id="Name" size="40" /> </label> <span class="textfieldRequiredMsg">A value is required.</span></span></p> <p><span id="sprytextfield3"> <label>Address <input name="Address" type="text" id="Address" size="40" /> </label> <span class="textfieldRequiredMsg">A value is required.</span></span></p> <p><span id="sprytextfield4"> <label>Phone number <input name="Phone_number" type="text" id="Phone number" size="15" /> </label> <span class="textfieldRequiredMsg">A value is required.</span></span> <span class="textfieldInvalidFormatMsg">Invalid format.</span> <span id="sprytextfield5"> <label>Cell number <input name="Cell_number" type="text" id="Cell number" size="15" /> </label> <span class="textfieldRequiredMsg">A value is required.</span> <span class="textfieldInvalidFormatMsg">Invalid format.</span></span></p> <p><span id="sprytextfield6"> <label>Email address <input name="Email" type="text" id="Email" size="40" /> </label> <span class="textfieldRequiredMsg">A value is required.</span> <span class="textfieldInvalidFormatMsg">Invalid format.</span></span><br /><br /><span style="color: #30F;">Sorry this form in development, please call or email for information.</span></p> </div> <!-- begin event info tab--> <div class="TabbedPanelsContent"> <p><span id="sprytextfield7"> <label>Event date <input name="Event_date" type="text" id="Event date" size="7" /> </label> <span class="textfieldRequiredMsg">A value is required.</span></span> <span id="sprytextfield9"> <label>Event time <input name="Event_time" type="text" id="Event time" size="7" /> </label> <span class="textfieldRequiredMsg">A value is required.</span></span> <span id="sprytextfield8"><label>Attendance <input name="Attendance" type="text" id="Attendance" size="7" /> </label> <span class="textfieldRequiredMsg">A value is required.</span></span></p> <p><span id="sprycheckbox1"> <label> Event location, rooms are available from 6:00 a.m.-12:00 a.m. <em>(check all that apply)</em><br /> <input name="banquet" type="checkbox" id="room1" value="banquet" /> Banquet Room (East or West, capacity 300) <input name="both" type="checkbox" id="room2" value="both" /> Both Rooms (capacity 550) <input name="bar" type="checkbox" id="room3" value="bar" /> Bar Area (capacity 50) </label></span></p> <p><span id="sprytextfield11"> <label>Contact name (day of event) <input name="Contact_name" type="text" id="Contact name" size="40" /> </label></span></p> <p><span id="sprytextfield12"> <label>Phone number <input name="Phone_number" type="text" id="Phone number" size="15" /> </label> <span class="textfieldInvalidFormatMsg">Invalid format.</span></span></p> </div> <!-- begin additional info tab--> <div class="TabbedPanelsContent"> <p><span id="sprycheckbox2"> <label> Electronic equipment needed, no extra charge <em>(check all that apply)</em><br /> <input name="DVD" type="checkbox" id="equipment1" value="DVD" /> DVD <input name="VHS" type="checkbox" id="equipment2" value="VHS" /> VHS <input name="built_in_screen" type="checkbox" id="equipment3" value="built-in screen" /> built-in screen <input name="built_in projector" type="checkbox" id="equipment4" value="built-in projector" /> built-in projector <input name="cable_TV" type="checkbox" id="equipment5" value="cable TV" /> cable TV <input name="Comcast_digital_radio" type="checkbox" id="equipment6" value="Comcast digital radio" /> Comcast digital radio <input name="wireless_internet" type="checkbox" id="equipment7" value="wireless internet" /> wireless internet <input name="wireless_mic" type="checkbox" id="equipment8" value="wireless mic" /> wireless mic <input name="laptop" type="checkbox" id="equipment9" value="laptop" /> laptop <br /> <input name="podium_w_mic" type="checkbox" id="equipment10" value="podium w/mic" /> podium w/mic <input name="white_board" type="checkbox" id="equipment11" value="white board" /> white board <input name="keyboard" type="checkbox" id="equipment12" value="keyboard" /> piano-quality keyboard <br /><br /> </label><label> Additional hardware, fees apply <em>(check all that apply)</em><br /> <input name="stage" type="checkbox" id="equipment13" value="stage" /> stage <input name="dance_floor" type="checkbox" id="equipment14" value="dance floor" /> dance floor </label></span></p> <p><span> <label>Questions or comments?<br /> <textarea name="Questions_or_comments" id="Questions or comments?" cols="45" rows="2"></textarea> </label> </span></p> </div> <!-- begin submit tab--> <div class="TabbedPanelsContent"> <p><span><span id="sprycheckbox3"> <label> <input name="Agreement" type="checkbox" id="Agreement" value="I understand and agree to be contacted" /> I understand that the information I have provided is for the sole use of Drake Centre and is<em><strong> only for an event request</strong></em>. The Drake Centre Event Coordinator will contact me to confirm date availablility and details of event.</label> <span class="checkboxRequiredMsg">Please make a selection.</span></span></span></p> <p><span> <label> <!--For immediate help please contact 970-492-6473, <br /> 7:00 a.m. – 2:00 p.m. Monday through Friday.<br /> <br />--> <input type="submit" name="Submit" id="submit" value="Submit" /> </label> </span> <span style="color: #30F;">Sorry this form in development, please call or email for information.</span></p> </div> </div> </div> <p> </p> <p> </p> <p> </p> </form> </div> </div> </div> </div><!-- #BeginLibraryItem "/Library/drake_footer.lbi" --><style type="text/css"> <!-- #copyright { text-align: right; font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #919191; } .footer { text-align: right; font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #919191; } --> </style> <table width="740" border="0" align="center"> <tr> <td width="733" class="footer">© 2014 Drake Centre | Photo contributions courtesy of Craig Vollmer Photography</td> </tr> </table> <!-- #EndLibraryItem --><script type="text/javascript"> <!-- var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1"); var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "none", {validateOn:["change"]}); var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "none", {isRequired:false, validateOn:["change"]}); var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "phone_number", {hint:"(000) 000-0000", validateOn:["change"]}); var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5", "phone_number", {hint:"(000) 000-0000", isRequired:false, validateOn:["change"]}); var sprytextfield6 = new Spry.Widget.ValidationTextField("sprytextfield6", "email", {validateOn:["change"]}); var sprytextfield7 = new Spry.Widget.ValidationTextField("sprytextfield7", "none", {isRequired:false, validateOn:["change"]}); var sprytextfield8 = new Spry.Widget.ValidationTextField("sprytextfield8", "none", {validateOn:["change"]}); var sprytextfield9 = new Spry.Widget.ValidationTextField("sprytextfield9", "none", {validateOn:["change"]}); var sprytextfield11 = new Spry.Widget.ValidationTextField("sprytextfield11", "none", {validateOn:["change"]}); var sprytextfield12 = new Spry.Widget.ValidationTextField("sprytextfield12", "phone_number", {hint:"(000) 000-0000", validateOn:["change"]}); var sprycheckbox1 = new Spry.Widget.ValidationCheckbox("sprycheckbox1", {maxSelections:3, minSelections:1}); var sprycheckbox2 = new Spry.Widget.ValidationCheckbox("sprycheckbox2", {maxSelections:14, minSelections:1}); var sprycheckbox3 = new Spry.Widget.ValidationCheckbox("sprycheckbox3"); //--> </script> </body> </html> -
Restrict user access in backend for specific pages!
tryingtolearn replied to z4z07's topic in PHP Coding Help
Maybe, it should at least echo $user_level if its being included. not just No Admin -
Restrict user access in backend for specific pages!
tryingtolearn replied to z4z07's topic in PHP Coding Help
Are you sure the path to access.php is correct? <?php include '_inc/access.php'; ?> -
Need help with PHP form to email script
tryingtolearn replied to newatthis123's topic in PHP Coding Help
You still have a ton of differences between the names in the form fields and your $_POST statements. Example: Your email field in your form is like this <input name="Email" type="text" id="Email" size="40" /> Your checking in your script like this $Email_address = $_POST['Email_address']; You named it Email in your form but assigning it Email_address in your process That wont work. They have to be the same. ------ Next - avoid using the - of / Remove those from names and variables. go back through both forms and make them the same Oh and add a } after mail($to,$email_subject,$message,$headers); to close the open if statement from the top if($_POST['Submit'] == "Submit") { Thats alot right now but its a start. Once thats working you are going to have to look into the security of the form. Not sure if you are aware of that or not. but we can tackle the form actually working first... Hope that all makes sense. -
Need help with PHP form to email script
tryingtolearn replied to newatthis123's topic in PHP Coding Help
post both of your updated pages -
Need help with PHP form to email script
tryingtolearn replied to newatthis123's topic in PHP Coding Help
You can't just change it to screen if the form field name is still built-in_screen. They always have to match. What is the code above line 81 Paste that exactly how you have it in your page. -
Need help with PHP form to email script
tryingtolearn replied to newatthis123's topic in PHP Coding Help
You are going to run into a few problems, Your form names in your .html file do not match your $_POST variables in your .php script The name part of the form is Name but the variable is name Notice the N vs n That happens in a few spots throughout your code. You also are checking for names that aren't in your form (message and questions for instance) Your submit button is named Submit but your .php is looking for formSubmit I would start with all those form names and $_POST names and make sure they match first. Get it to that point and see how much closer things get to working.