PHP - In Place
Hi guys,
I can't find any code to help me out with this so I was hoping you guys can. I need some PHP jquery/AJAX code that allows me to do the following: Double click a disabled text box, edit the value and on click out (or whatever) it re-disables and makes the chages in the mysql DB automatically. Hope you guys can help me out. Cheers in advance Similar TutorialsI currently have a Javascript placed at the top of the same file as my HTML form. Now I need to run the file as PHP, and was wondering what the proper protocol and best practice is for the JavaScript (which does some client side validation). Can I leave it as is, at the top of the file after changing the extention to PHP. If I put it in a seperate file, should I call it as a JavaScript or as an INCLUDE file. If I INCLUDE it, should the INCLUDE be a PHP file (that contains the JS, or a JS extention. Does any of this make a difference, or will any method work, leaving it to personal preference? I have gleaned a script from modified bits of tutorials and ended up with this: <td> <form name="input" action="fotw.php" method="post"> <h4>Want a specific film? <input type="text" width="300" name="requests" /> <input type="submit" value="Request" /><input type="hidden" name="thanks" /></h4> </form> </td> <?php $requests = $_POST['requests']; $data = "$requests\n"; $fh = fopen("../filmoftheweek/users.txt", "a"); fwrite($fh, $data); fclose($fh); /*if (???????? HELP!);*/ // request button has been clicked echo "Thanks, I'll see what I can do."; // In the field I have highlighted in red ?> What I want to do is get the Thanks message to print to the right of the request button but, being a total noob because I didn't pay attention at college during any php bits, I have no idea how to go about it. It's just a visual thing really as I know the text file gets written but, disappearing text does little to reassure the user that something has happened. Probably the field won't be any good as a place to get printed but I tried (for hours) on this. Any help would be greatly appreciated. Along with an explanation, doubly so. Many thanks in advance, Paul Note to moderators: CSS is an acronym for Cascading Style..? Sheet/sheets [attachment deleted by admin] Hi all, I could do with some help ... What I am trying to do is insert some additional div in the piece of code you will see below, but I've been having some troubles as to what stntax I should be using and where to place those div ... In order to help you help me, I suggest you have a look at this page elhoster2.com/europeshuttle , make a search with country "sweden" as "return trip" . From there you will see 2 results. This is the page I am trying to layout. Basically, the image is on the left and then I would like to have a div floated on the left that will contain the services (multilingual driver , greeting sign etc ), another div with the info seen in bold (passengers =1, charges are per vehicle) and a last div with all pricing info. My issue is that I don't really know how to break this piece of php code to achieve the desire effect ... I hope someone will be kind enough to help me with this. Code: [Select] function get_tours($type,$country,$airport_start,$city_start,$psg,$way){ $mysql=new MYSQL; $q="select * from tours where tour_country ='$country' and tour_airport='$airport_start'and tour_city='$city_start' and tour_standard='$type' and veh_seats >='$psg'"; $res=mysql_query($q,$mysql->connection); if(mysql_num_rows($res)>0){ while($r=mysql_fetch_array($res)){echo'<form id="booking_2" action="booking-form.php" method="post">'; echo'<div class="search-results spacing-bot" ><figure class="img-indent"> <a class="lightbox-image" href="'.SITE.$r['tour_vehicle_picture'].'" data-gal="prettyPhoto[gallery1]"><img src="'.SITE.$r['tour_vehicle_picture'].'" width="188" height="138" alt=""></a></figure> <div class="search-results-info">'; #THIS IS WHERE THE SERVICE LIST BEGINS ########################################### $tour_id=$r['tour_id']; $serv="select * from services_to_tour where tour_id='$tour_id'"; $re=mysql_query($serv,$mysql->connection); while($ro=mysql_fetch_array($re)){ $serv_id=$ro['serv_id']; $this->get_serv($serv_id); } #THIS IS WHERE THE SERVICE LIST ENDS I GUESS AND THAT I WOULD LIKE TO BE IN ITS OWN DIV ########################################### #FROM HERE I AM GETTING A BIT CONFUSED WITH THE PHP AND HAVE NO IDEA HOW TO STYLE IT !!!########################################### $crg_by=$r['tour_price_per']; if($crg_by=='per vehicle'){ $crg='per vehicle'; $tour_price= $r['tour_price'] ; $tour_r=$r['tour_price_return']; $total=$r['tour_price'] + $r['tour_price_return'] ; $total_i=$r['tour_price']; $total_b=$r['tour_price_return']; } elseif($crg_by=='per person'){ $crg='per passenger';$total_i=$r['tour_price'] * $psg; $tour_price= $r['tour_price'] * $psg; $tour_r=$r['tour_price_return']* $psg; $total= $tour_price + $tour_price; } if($way=='Return'){$price='Collection: '.$tour_price.' Euros<br />Return: '.$tour_r.' Euros'; $total=$total; $amount=$total;$percent='15'; $online=$this->get_percent($amount,$percent); $pr=$online;$total='<br />Total Price: '.$total.' Euros<br />Payable online: '.$online.' Euros'; } else{$amount=$tour_price;$percent='15'; $online=$this->get_percent($amount,$percent); $price='Price: '.$tour_price.' Euros<br />Payable online: '.$online.' Euros';$total='';$pr=$r['tour_price']; $pr=$online; } echo'<span class="p1"><strong>Passengers:</strong></span> '.$psg.'<br /><span class="p1"><strong>Charges are by '.$crg.'</strong></span><br /><span class="p1"><strong>Price </strong></span><br />'.$price.$total.'<input type="hidden" name="tour_id" value="'.$tour_id.'" /> <input type="hidden" name="way" value="'.$way.'" /><input type="hidden" name="psg" value="'.$psg.'" /><input type="hidden" name="price" value="'.$pr.'" /><input type="hidden" name="price_in" value="'.$total_i.'" /><input type="hidden" name="price_out" value="'.$total_b.'" /><input type="hidden" name="operator" value="'.$r['operator_id'].'" /><a onClick="document.getElementById(\'booking_2\').submit()" class="button" style="float:right"><strong><strong>book this transfer</strong></strong></a></form> </div> <div class="border-bot"></div> </div>'; } } else{echo'<p>Sorry your search returned no results.</p>';} } What would be the best way to break the following html into a table <div class="highlight">Name: CHRISTOPHER</div> <table summary="This table contains status information for the selected name."> <caption>Selected name status Information</caption> <tr> <th>Current Name:</th> <td>CHRISTOPHER</td> </tr> <tr> <th>Initial Filing Date:</th> <td>DECEMBER 15, 1997</td> </tr> <tr> <th>County:</th> <td>NEW YORK</td> </tr> <tr> <th>Jurisdiction:</th> <td>NEW YORK</td> </tr> <tr> <th>Type:</th> <td>Full Member</td> </tr> Would pregmatch or COMDocument be easier? Greetings once again, My script retrieves variables from a database and pre-populates a form: Code: [Select] <input type="text"" name="First" value="<?php echo stripslashes($row['First']); ?>" > Simple to do with text fields, but not as simple for checkboxes: Code: [Select] <input type="checkbox" name="Subject" size="27" value="Math" checked> In the past I've used JavaScript to place a check in a checkbox, based on the value in the database. Can anyone show me a simple way to use PHP to place the check if the variable found in the database is in fact "Math"; but leave it it unchecked if the Subject value is empty? As always, thank you! ~Wayne Got this working script that sends email via a form:
<?php
$name = $_POST['name'];
} else { }
{ } ?>
Problem is, I want a bar to appear saying 'Message Sent. We Will Contact You Shortly'. I'm brand new to php and followed a tutorial for the above. It's a simple form that I understand, apart from the code needed for confirmation! Please can someone offer any assistance. Thanks in advance......
I have a membership directory that I've been working with for a long time, and recent server upgrades with MySQL, PHP, etc. forced me to do some recoding. While I was doing that, I wanted to try and make some improvements. I must give a brief description of the intent, and then the results I got, so someone can sort out the problem for me. I have a query that selects all "Agent" members, then orders them by County, then by Company Name. What I am trying to do is create a new heading in my list every time the County information changes as the list is sorted and output to my table.
I am going to attache 2 .php files with my code. The agent_member_list.php is the original code that pulls all of the members properly, and results can be viewed he http://www.nmlta.org...member_list.php
The agent2_member_list.php is where I'm trying to insert the new conditional statement to print my County headings when a new County is encountered in the results. The heading actually works, and changes correctly, but the problem is that the first member entry in every county is not printed in the output. I know the query is correct, so I'm sure I've got the conditional "if" for checking County field wrong, or misplaced. Here is the link to it: http://www.nmlta.org...member_list.php
I'm hoping someone can spot my error pretty quickly, I only dabble in this very rarely. Thanks for any help!
Attached Files
agent2_member_list.php 5.06KB
3 downloads
agent_member_list.php 4.82KB
2 downloads I want to create many PDF pages by using a PDF document template that uses place holders
The data would come from a CSV file
I've looked into a solution for the above for a couple of years now!
I haven't found anything that would do the trick for me
It seems as though PDF and PHP don't go well - especially if I want to use a template with place holders
Just looking for suggestions
Thanks
EDIT: forget PDF... is it possible to use something else? Like a Word doc??
OM
Edited by OM2, 05 June 2014 - 09:07 PM. I need a way to find numbers 0000-9999 where no number has more than 2 digits in the same place in common. I know PHP but this is a little beyond me, can anyone help? Hiya peeps! I have this code; if(preg_match('([0-9]{5})', $this->_searchString)) { echo '5 characters, numbers only.'; } elseif(preg_match('([0-9]{7})', $this->_searchString)) { echo '7 characters, numbers only.'; } The 7 characters are not working for some reason, I have used this preg_match regex all over my script and it's working everywhere else but with this? Can anyone see any reason why it is not working? Many thanks, James. Hello, I'm getting my feet wet with PHP and databases. I've read that I can provide the login for a database in a separate file, which I can place in a directory located OUTSIDE of my site (parent folder). This works fine at the isp where my site is being hosted. However, now I want to do the same thing at a site that is hosted at (ugh) GoDaddy. Unfortunately, GoDaddy does not allow access outside of the site (aka parent folder of the site). So now where am I supposed to put the file with the database login info in it so it will be secure? Thank you. I need my code to generate the following HTML: Code: [Select] div id="wowslider-container1"> <div class="ws_images"> <span><img src="https://alaskapac.centertix.net/UPLImage/aca_beauty.jpg" alt="Disney's Beauty & the Beast" title="Disney's Beauty & the Beast" id="wows0" /></span> <span><img src="https://alaskapac.centertix.net/UPLImage/ss_scaredscriptless.jpg" alt="Scared Scriptless" title="Scared Scriptless" id="wows1" /></span> <span><img src="https://alaskapac.centertix.net/UPLImage/aysc_worldcupofwines.jpg" alt="World Cup of Wines" title="World Cup of Wines" id="wows2" /></span> <span><img src="https://alaskapac.centertix.net/UPLImage/aso_outofthisworld.jpg" alt="Anchorage Symphony's Out of This World" title="Anchorage Symphony's Out of This World" id="wows3" /></span> <span><img src="https://alaskapac.centertix.net/UPLImage/aca_mikegarson.jpg" alt="Mike Garson" title="Mike Garson" id="wows4" /></span> <span><img src="https://alaskapac.centertix.net/UPLImage/ctc_pinkalicious.jpg" alt="Pinkalicious!" title="Pinkalicious!" id="wows5" /></span> <span><img src="https://alaskapac.centertix.net/UPLImage/aso_silentfilm.jpg" alt="Anchorage Symphony's Silent Film Double Feature" title="Anchorage Symphony's Silent Film Double Feature" id="wows6" /></span> <span><img src="https://alaskapac.centertix.net/UPLImage/aca_rockofages.jpg" alt="Rock of Ages" title="Rock of Ages" id="wows7" /></span> <span><img src="https://alaskapac.centertix.net/UPLImage/pdc_concert.jpg" alt="Pulse Dance Company in Concert" title="Pulse Dance Company in Concert" id="wows8" /></span> <span><img src="https://alaskapac.centertix.net/UPLImage/aca_mannheimsteamroller.jpg" alt="The Christmas Music of Mannheim Steamroller" title="The Christmas Music of Mannheim Steamroller" id="wows9" /></span> <span><img src="https://alaskapac.centertix.net/UPLImage/alex_zlatkovski.jpg" alt="Alexander Zlatkovski" title="Alexander Zlatkovski" id="wows10" /></span> <span><img src="https://alaskapac.centertix.net/UPLImage/wsp_joshritter.jpg" alt="Josh Ritter" title="Josh Ritter" id="wows11" /></span> <span><img src="https://alaskapac.centertix.net/UPLImage/z_acpa_giftcertificates.jpg" alt="Gift Certificates" title="Gift Certificates" id="wows12" /></span> <span><img src="https://alaskapac.centertix.net/UPLImage/adp_fireice.jpg" alt="New Year's Eve Celebration" title="New Year's Eve Celebration" id="wows13" /></span> </div><div class="ws_bullets"><div> <a href="#wows0" title="Disney's Beauty & the Beast"><img src="https://alaskapac.centertix.net/UPLImage/aca_beauty.jpg" alt="Disney's Beauty & the Beast" />1</a> <a href="#wows1" title="Scared Scriptless"><img src="https://alaskapac.centertix.net/UPLImage/ss_scaredscriptless.jpg" alt="Scared Scriptless" />2</a> <a href="#wows2" title="World Cup of Wines"><img src="https://alaskapac.centertix.net/UPLImage/aysc_worldcupofwines.jpg" alt="World Cup of Wines" />3</a> <a href="#wows3" title="Anchorage Symphony's Out of This World"><img src="https://alaskapac.centertix.net/UPLImage/aso_outofthisworld.jpg" alt="Anchorage Symphony's Out of This World" />4</a> <a href="#wows4" title="Mike Garson"><img src="https://alaskapac.centertix.net/UPLImage/aca_mikegarson.jpg" alt="Mike Garson" />5</a> <a href="#wows5" title="Pinkalicious!"><img src="https://alaskapac.centertix.net/UPLImage/ctc_pinkalicious.jpg" alt="Pinkalicious!" />6</a> <a href="#wows6" title="Anchorage Symphony's Silent Film Double Feature"><img src="https://alaskapac.centertix.net/UPLImage/aso_silentfilm.jpg" alt="Anchorage Symphony's Silent Film Double Feature" />7</a> <a href="#wows7" title="Rock of Ages"><img src="https://alaskapac.centertix.net/UPLImage/aca_rockofages.jpg" alt="Rock of Ages" />8</a> <a href="#wows8" title="Pulse Dance Company in Concert"><img src="https://alaskapac.centertix.net/UPLImage/pdc_concert.jpg" alt="Pulse Dance Company in Concert" />9</a> <a href="#wows9" title="The Christmas Music of Mannheim Steamroller"><img src="https://alaskapac.centertix.net/UPLImage/aca_mannheimsteamroller.jpg" alt="The Christmas Music of Mannheim Steamroller" />10</a> <a href="#wows10" title="Alexander Zlatkovski"><img src="https://alaskapac.centertix.net/UPLImage/alex_zlatkovski.jpg" alt="Alexander Zlatkovski" />11</a> <a href="#wows11" title="Josh Ritter"><img src="https://alaskapac.centertix.net/UPLImage/wsp_joshritter.jpg" alt="Josh Ritter" />12</a> <a href="#wows12" title="Gift Certificates"><img src="https://alaskapac.centertix.net/UPLImage/z_acpa_giftcertificates.jpg" alt="Gift Certificates" />13</a> <a href="#wows13" title="New Year's Eve Celebration"><img src="https://alaskapac.centertix.net/UPLImage/adp_fireice.jpg" alt="New Year's Eve Celebration" />14</a> </div></div> </div> So I assumed that it would be something similar to the following: Code: [Select] while ($Row = mysqli_fetch_assoc($carouselResult)){ $EventName = $Row['EventTitle']; $image = $Row['eImage']; /* $big_image = LISTING OF ALL IMAGES */ $big_image = array('<span><img src="https://alaskapac.centertix.net/UPLImage/' . $image . '" alt="' . $EventName. '" title="' . $EventName . '" id="wows'. $i .'" /></span>'."\n"); $i2 = $i; $i = $i+1; /* $nav_image = TINY BOXES TO NAVIGATE THROUGHOUT CAROUSEL */ $nav_image = array('<a href="#wows' . $i2 . '" title="'.$EventName.'"><img src="https://alaskapac.centertix.net/UPLImage/' . $image . '" alt="' . $EventName. '" />'.$i.'</a>'."\n"); $i2 = $i2+1; } echo '<div id="wowslider-container1">'."\n".'<div class="ws_images">'."\n"; echo array($big_image); echo '</div><div class="ws_bullets"><div>'."\n"; echo array($nav_image); echo '</div></div>'."\n".'</div>'; But array($big_image) and array($nav_image) do not work as I expected and it just produces the following HTML code: Code: [Select] <div id="wowslider-container1"> <div class="ws_images"> Array</div><div class="ws_bullets"><div> Array</div></div> </div> Can anyone help out a beginner in PHP? I have this code:
<td><form action="" method="post" name="TableData" class="style5" id="TableData"> <table width="800" border="0" bordercolor="#000000" background="Assets/Tablebar.gif"> <!--DWLayoutTable--> <tr> <td width="183" height="20" align="center"><div align="center" class="style11 style1"></div></td> <td width="317" align="center"><div align="center" class="style11"><span class="style2"><?php echo $row_TableData['UserID']; ?></span></div></td> <td width="136" align="center"><div align="center" class="style11"><span class="style2"><?php echo $row_TableData['UserName']; ?></span></div></td> <td width="136" align="center"><div align="center" class="style2 style11"><span class="style11"><span class="style2"><?php echo $row_TableData['Score']; ?></span></span></div></td> <td width="103" align="center" valign="top"><span class="style2 style11"> <?php for($i = 0; $i < $row_TableData['TourWins']; $i++) { echo '<img src="Assets/Medal.gif" />'; } ?> </span></td> </tr> </table> </form> </td> The Table displays fine and it sorts fine win Highest to lowest score, I am wanting to put place numbers Like 1,2,3,4 etc in the first Colom which is in bold, but I don't know what to use. any help would be great. I have recently started a Wordpress Site (www.edsstudios.com). Let me say in advance I am a designer and not a coder, hence the need to come to this forum. I installed a theme which I would like to customize on the home page. I want to place three images along with text below the image slider of the theme. I have included an attachment (pic1.jpg) showing the photoshop mock of how I want the home page to look. Keep in mind I only want to add the image below the image slider. The rest of the page is already existing as part of the wordpress theme. So, I sliced up only the images from the photoshop mock(pic2.jpg) within photoshop and produced the web ready images and html code. I opened the home.php file but can't get the code to function. Below is the code for the home.php page first. Below that is the html code for the images. Can someone tell me if there is something wrong with the code for the images along with where to place it on the home.php file? Home.php CODE <!-- --><?php get_header(); ?> <div id="contenthome"> <div id="slider"> <p> <?php include(TEMPLATEPATH."/includes/slider.php");?> </p> </div> <div id="homepage"> <div class="homepageright"> <div id="subscribe" class="widget"> <h4><span><?php _e("Subscribe", 'organicthemes'); ?></span></h4> <p><?php _e("Receive news and updates from us.", 'organicthemes'); ?></p><form action="http://feedburner.google.com/fb/a/mailverify" method="post" target="popupwindow" onsubmit="window.open('http://feedburner.google.com/fb/a/mailverify?uri=<?php echo ot_option('feedburner'); ?>', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true"><input type="text" value="Enter your email address..." id="subbox" onfocus="if (this.value == 'Enter your email address...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Enter your email address...';}" name="email"/><input type="hidden" value="<?php echo ot_option('feedburner'); ?>" name="uri"/><input type="hidden" name="loc" value="en_US"/><input type="submit" value="Subscribe" id="subbutton" /><input type="hidden" value="eNews Subscribe" name="title"/></form> </div> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Home Sidebar') ) : ?> <div class="widget"> <h4>Widget Area</h4> <p>This section is widgetized. To add widgets here, go to the <a href="<?php echo admin_url(); ?>widgets.php">Widgets</a> panel in your WordPress admin, and add the widgets you would like to <strong>Homepage Top Right</strong>.</p> <p><small>*This message will be overwritten after widgets have been added</small></p> </div> <?php endif; ?> </div> <div class="homepageleft"> <h3><?php echo cat_id_to_name(ot_option('hp_cat')); ?></h3> <?php $recent = new WP_Query("cat=" .ot_option('hp_cat'). "&showposts=" .ot_option('hp_num') ); while($recent->have_posts()) : $recent->the_post();?> <div class="postarea"> <div class="posttitle"> <h2><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2> <a class="commenticon" href="<?php the_permalink(); ?>#comment" title="Comments"><?php comments_number('0', '1', '%'); ?></a> </div> <div class="homecontent"> <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_post_thumbnail( 'home-thumbnail' ); ?></a> <p><?php the_excerpt(); ?></p> <p><a class="more-link" href="<?php the_permalink() ?>">Read More</a></p> </div> </div> <?php endwhile; ?> </div> </div> </div> <!-- The main column ends --> <?php get_footer(); ?> IMAGES CODE <html> <head> <title>home page icons</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script type="text/javascript"> <!-- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc; } 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.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}} } 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[n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.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))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> </head> <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('images/home-page-icons_05ro.png','images/home-page-icons_07ro.png','images/home-page-icons_09ro.png')"> <!-- ImageReady Slices (home page icons.psd) --> <table width="960" height="183" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01"> <tr> <td colspan="3"> <img src="images/home-page-icons_01.png" width="310" height="143" alt=""></td> <td colspan="3"> <img src="images/home-page-icons_02.png" width="332" height="143" alt=""></td> <td colspan="3"> <img src="images/home-page-icons_03.png" width="318" height="143" alt=""></td> </tr> <tr> <td> <img src="images/home-page-icons_04.png" width="223" height="39" alt=""></td> <td><div align="center"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image19','','images/home-page-icons_05ro.png',1)"><img src="images/home-page-icons_05.png" name="Image19" width="66" height="39" border="0"></a></div></td> <td colspan="2"> <img src="images/home-page-icons_06.png" width="273" height="39" alt=""></td> <td><div align="center"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image20','','images/home-page-icons_07ro.png',1)"><img src="images/home-page-icons_07.png" name="Image20" width="65" height="39" border="0"></a></div></td> <td colspan="2"> <img src="images/home-page-icons_08.png" width="248" height="39" alt=""></td> <td><div align="center"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image21','','images/home-page-icons_09ro.png',1)"><img src="images/home-page-icons_09.png" name="Image21" width="62" height="39" border="0"></a></div></td> <td> <img src="images/home-page-icons_10.png" width="23" height="39" alt=""></td> </tr> <tr> <td> <img src="images/spacer.gif" width="223" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="66" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="21" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="252" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="65" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="15" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="233" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="62" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="23" height="1" alt=""></td> </tr> </table> <!-- End ImageReady Sl hello, I want to display the echo ''"; in the right place on my website in changepassword_form.html all messages are written in changepassword.php. how can i move these echo after entering the wrong password or username? changepassword.php <?php ........... //success //change password in db $querychange = mysql_query("UPDATE users SET password='$newpassword' WHERE username='$username'"); session_destroy(); echo 'Password Has Been Changed Successfully !'; //move these } else{ echo('new password doesnt match!'); //move these } } else { die('old password doesnt match!'); //move these } } else { echo ""; include 'changepassword_form.html'; exit(); } } else{ echo 'you must be logged '; } ?> move these echos somewhere to my html code how to do these?? This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=334133.0 <?php include_once("includes/config.php"); if(!$_GET['id'] && $_POST['id']) { $id = mysql_real_escape_string($_POST['id']); } elseif($_GET['id'] && !$_POST['id']) { $id = mysql_real_escape_string($_GET['id']); } else { } if(!$id) { $content = "Sorry, you have not selected a skin to view."; } else { $extract_information = mysql_query("SELECT title,username,downloads,views,id FROM skins WHERE id = '$id' LIMIT 1"); if(mysql_num_rows($extract_information) == 0) { $content = "Sorry, no skin exists with this ID."; } else { $extract = mysql_fetch_assoc($extract_information); function displayBody() { mysql_query("UPDATE skins SET views = views + 1 WHERE id = '$id'"); echo $extract['title']. ", by ". $extract['username'] ."."; } if(!$extract['password']) { $content = displayBody(); } elseif(!$password) { $content = "<br/><br/><div id='header'>Password</div> <form action='view.php' method='POST'><input type='password' name='password'> <input type='submit' value='View'></form>"; } else { if($password != $extract['password']) { $content = "You have entered in an incorrect password. <a href='view.php?id=". $id ."'>Try Again</a> or <a href='index.php'>Home</a>."; } else { $content = displayBody(); } } } } ?> <html> <head> <title><?php $title; ?></title> <link rel="stylesheet" type="text/css" href="theme/style.css" /> </head> <body> <div id="header"> MCSkins </div> <?php echo $content; ?> </table> </center> </body> </html> In the code above, the function does not include the data properly as seen he http://stonedknights.net46.net/view.php?id=2 And, why is the information above the black bar/title? In the code, you can see $content is echo'ed below the div id. So, why does the text appear above it? This has been bothering me for a while, how do I do this? echo (" <form method = 'get' action = 'member.php?action=Search&option=faction&name=NAME'> Faction's Name: <input type='text' name='member' /><br /><br /> <input type='submit' value='Search' /> </form> "); name='member' is supposed to be sent with he member.php?action=Search&option=faction&name=NAME. Obviously replacing NAME with the input. I have created a simple form that collects a comment or question from a visitor to my website. The problem is that if the visitor types: Your site looks Ok. I will get that message. But if the type: Your site needs "Work". I will get: Your site needs The script will not send the double quotes or anything after the double quotes What am I missing??? I have tried: addslashes() str_replace() preg_replace() with on change to the message. This is the script Code: [Select] <?php $recipient = $_POST['recipient']; $subject = $_POST['subject']; $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $senders_email_address = $_POST['senders_email_address']; $comments = $_POST['comments']; $mailheaders .= "To: Thin Dime Web. <$recipient>\n"; $mailheaders .= "From: $first_name $last_name <$senders_email_address>\n"; $body .= "Subject: $subject\n\n"; $body .= "Senders Name: $first_name $last_name\n"; $body .= "E-mail Address: $senders_email_address\n\n"; $body .= "The following Comments or Question came from a visitor to your website\n"; $body .= "\n"; $body .= "$comments\n"; mail("$recipient", "$subject", "$body", "$mailheaders"); ?> |