Search the Community
Showing results for tags 'multipleform'.
-
Hi, sorry if this has come up before. I had a quick look through the forum but could find anything. I've been having a problem with this code for the last while and I can't seem to figure it out. I'm not all that proficient in PHP. I've a gallery of images from a festival. When people looking through the photo's spot themselves they click a callout "I'm in this photo!' When they click the call out a window pops up with a form. I need the imageID to transfer to that form, and then after completion of that form gets saved to the data base. Page 1: The Gallery. <li> <a class="thumb" name="007" id="007" href="images/9133440_DSC_0087.jpg" title="Title #6"> <img src="images/9133440_DSC_0087_thumb.jpg" alt="Title #6" /> </a> <div class="caption"> <!-- <div class="image-desc">Description</div> --> </div> </li> </ul> </div> <div id="inphoto"> <a href="#" onclick="wopen('compentry.php?imageid=<?php echo $imageID; ?>', 'popup', 448, 590); return false;"><img src="assets/inphotobutton.jpg"></a> </div> Page 2: The Competition Form. <div id="form"> <form name="epcomp" id="epcomp" method="GET" action="form.php" > <p class="name"><label>Full Name:</label><br/> <input type="text" name="name" id="name" value="Your Name" onblur="if(this.value == '') { this.value='Your Name'}" onfocus="if (this.value == 'Your Name') {this.value=''}" maxlength="30" required/></p> <p class="email"><label>Your Email:</label><br/> <input type="email" name="email" id="email" value="Your email" onblur="if(this.value == '') { this.value='Your email'}" onfocus="if (this.value == 'Your email') {this.value=''}" maxlength="60" required /> </p> <p class="entry"><label>Your favourite festival moment: <span style="font-size:10px;">(Max 50 words)</label> <br/> <p><textarea cols="40" rows="5" name="entry" id="entry" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;" maxlength="50" required>Enter you answer here...</textarea></p> <p class="button"><input class="button" type="submit" value="Enter Competition" name="formSubmit"/></p> <?php echo '<input type="hidden" name="photoId" value="' . $_GET['imageID'] . '">' ?> </form> And Page 3: The Form.php page. $imageID = $_GET['imageID']; $varName = $_GET['name']; $varEmail = $_GET['email']; $varEntry = $_GET['entry']; $query = "insert into comp_entry (imageID, name, email, entry) values ('$imageID' , '$varName' , '$varEmail' , ' $varEntry')"; $qresult = mysql_query($query); ?> <input class="button" type="button" value="Close" onclick="closeWin()"> </div> Can anyone point me on the right path, any help would be greatly appreciated.