-
Ajax and PHP array issue
I have a problem with submitting an array of data via ajax submit. If I disable the ajax ... my php handling seems to work perfect but with the ajax added it seems to be conflicting with my foreach loop within my php. My form code is: <tr><td><textarea class="text" name="event_summary[]" rows="1" cols="1"></textarea></td></tr> <tr><td><textarea class="text" name="event_summary[]" rows="1" cols="1"></textarea></td></tr> <tr><td><textarea class="text" name="event_summary[]" rows="1" cols="1"></textarea></td></tr> <tr><td><textarea class="text" name="event_summary[]" rows="1" cols="1"></textarea></td></tr> <tr><td><textarea class="text" name="event_summary[]" rows="1" cols="1"></textarea></td></tr> This code for my php is: foreach ($_POST["event_summary"] as $single_summary) { // check the value for empty line $single_summary = trim($single_summary); if (!empty($single_summary)) { $insertEventSummary = mysql_query("INSERT INTO EVENT_SUMMARY (PatientID, Description) VALUES ('$patientID', '$single_summary')"); } } And the code being used to create the array via jquery is: var event_summary = new Array(); $("textarea[name^='event_summary[]']").each(function() {event_summary.push($(this).val());}); If anyone could help me shed some light into exactly what the problem is, it would be very appreciated. Thanks
-
Inserting multiple checkbox data into a database
Thanks Jock! +1
-
-
Inserting multiple checkbox data into a database
Hi, I was wondering if anyone could help me ... i'm currently trying to store the values of some checkboxes into a database but for some reason I don't think I am doing it correctly. Could someone offer advice? Here is my code: <input type="checkbox" name="LogoRedesignReason[]" value="Changing_Market"> <label>Update the overall look</label> <br /> <input type="checkbox" name="LogoRedesignReason[]" value="Raise_Profile"> <label>To reflect the changing market</label> <br /> <input type="checkbox" name="LogoRedesignReason[]" value="Change_Direction"> <label>Raise profile</label> <br /> and here is my php code: if (isset($_POST['LogoRedesignReason'])) { $getLogoRedesignReason = serialize($_POST['LogoRedesignReason']); } else { $getLogoRedesignReason = FALSE; echo '<p>No checkboxes were checked.</p>'; } Then obviously I go about inserting that data into the database. The problem i'm getting is the stored data is appearing like this: s:0:""; Which I believe is incorrect?!?
-
php Mail () function
Hi people, I have a problem ... recently I have been attempting to use some very some code of a clients side simply to send mail from their contact form. I've used my code on several different sites and it definately works, however on the clients site it won't work at all. It doesn' throw up any php errors just simply shows the confirmation message and doesn't send the mail. Here is the code: $name = $_POST['name']; $email = $_POST['email']; $subject = $_POST['sub']; $message = $_POST['body']; $body = 'FROM: ' . $name . "\n" . 'SUBJECT: ' . $subject . "\n" . ' MESSAGE: ' . $message; mail( "example@example.co.uk", "Form Contact: $subject", $body, "From: $email", "-f".$email); if (!eregi ('^[[:alnum:]][a-z0-9_\.\-]*@[a-z0-9\.\-]+\.[a-z]{2,4}$',stripslashes(trim($email)))) { $problem = TRUE; $emessage .= $email . ' is an invalid email address. Please go back and try again.'; } if (!$problem) { echo '<div class="content-frame"><p>Thank you for your email.</p></div>'; } else { echo $emessage; } If people are able to ... Can you suggest solutions if you spot any issues with the particular code that I am using? The clients server has the mail function set up but is using windows with IIS with PHP support. Could this be an issue?
-
Page Preloader
Hi guys, I was wondering if anyone could inform me if there is a way of creating a page preloader with php? So for example when a user logs into say an admin feature it could either show up a loading bar similar to google mail or say something like "sync in progress..." whilst the background loads? I'd like to use it for an application I am developing and any help would be appreciated. Thanks, Mark
-
Portfolio Website
honest opinions welcome http://www.MarkOrral.co.uk
-
Portfolio Website
Thanks guys! I know its looking empty but its purely because im still working on the overall look and design of the site. I've kinda hit a dead end in terms of having the content section stand out. I tried adding a slight shadow as seen in version 2 but im not sure if i like it enough. Any ideas?!
-
Portfolio Website
haha!! Ahhh cheers man! Completely didn't notice i'd made that mistake!
-
Just saying hi
Hey people! I'm new to this site and need a few pointers on my current project. www.MarkOrral.co.uk So if anyone can be of assistance it would be much appreciated! Mark
-
Portfolio Website
Hey guys, i've just joined so....hi! lol Anyway here is my site Website version 1 I really can't decide if i like it or not and i made a slight change if you go to Website version 2 I'd like some feedback please guys and girls Thanks, Mark.