PHP - Page Break For Table
I have print page using window.print in the body tag at the beginning of php file and i am trying to make the rest of the code as second page, the last table will be on the second page. it is not working. code: <b>Absent Report:</b> <table style ="page-break-before: always;" border='1'> <tr><th>ID</th><th>Name</th><th>Absent</th></tr> <?=$tdata?> </table> <a href="singlereportbyid.php" width="100%">Click here to go back to Main Menu</a> </div> </div> </div> </div> </body> </html> why it is not working? Similar TutorialsSo I have built a coupon component for Joomla which is working nicely.. However I am very green when it comes to Mysql and PHP more so the MySql part .. any way The user selects coupons adds them to a printing shopping cart so to speak and then prints the coupons. However 4 coupons print fine to a page but the 5th coupon gets cut in half. I have tried spacing stuff out etc however since CSS is just a recommendation and there is not standard across so many browsers. It is just a mess. I did some googling and saw I can do a page break after so many rows however there is not alot of info on the structure so hoping some one can help. Here is actually the complete code from the print page. Code: [Select] <?php define('_JEXEC', '1'); include("../../configuration.php"); $config = new JConfig(); $conn = mysql_connect($config->host, $config->user, $config->password) or die("can not connect."); mysql_select_db($config->db) or die("can not connect."); $couponIds = implode(",", $_POST['selectCoupon']); $coupon_footer_text = ""; $query = "select * from joc_other_settings limit 0,1 "; $res = mysql_query($query ); $row = mysql_fetch_assoc($res); $coupon_footer_text = $row['coupon_footer_text']; $query = "select * from joc_logo where status='1' limit 0,1"; $res = mysql_query($query ); $logo = mysql_fetch_assoc($res); $sql = "select * from joc_coupon c inner join joc_merchant m on c.mer_id=m.mer_id where c.cpn_id in (".$couponIds.")"; $res = mysql_query($sql); if(mysql_num_rows($res) > 0) { while($row = mysql_fetch_assoc($res)) { $address = $row['address']."<br>".$row['city'].", ".$row['state']."-".$row['zip']; $logoToShow = ($row['logo']!="")?"images/".$row['logo']:"images/company_logo/".$logo['logo']; //////////// Begin Coupon ///////////////// ?> <head> <link rel = "stylesheet" type="text/css" href="/components/com_coupon/print.css" > </head> <body> <div id="box"> <div class="cpntitle"><?=$row['cpn_title']?></div> <div class="cpndesc"><?=$row['cpn_desc']?></div> <div class="boxlogo"><img height="75" width="175" src="../../<?=$logoToShow?>"></div> <br /> <div class="cpnres">Sku: <?=$row['cpn_restriction']?></div> <div class="cpnexp">Expires On: <?=date("m/d/Y", $row['cpn_expire'])?></div> <img src="/images/cpimg/coupon_bottom.png"> </div> <br /> <?php /////// End Coupon ////////// } } ?> <script type="text/javascript"> window.print(); </script> I am pretty sure the page break goes in after Code: [Select] while($row = mysql_fetch_assoc($res))But the actual structure is killing me. If some one can help me with this I would be great full could even shoot a few bucks over PayPal if you want. Thanks Hi, I am trying to translate a page in PHP using Google API. There is 5000 chars limit on data that you can send to Google at a time. So I am trying to break the page into pieces of 5000 chars. But as you know while doing this we have to keep in mind the HTML formatting that it should not be disturbed otherwise you will not get desired results. For example you have to send this: <a href="#" class="myclass">Link</a> Instead of this: <a href="#" class="myclas I am able to solve it somehow (although not perfectly I guess) by checking if "<" sign is coming after ">" sign or not. If "<" sign is coming after ">" then I go back to the point where I found ">" and cut string from there. Anyway the point is I am still having some problems regarding HTML formatting and want to know how to do it efficiently. Is there any parser available that will solve this problem!? Thanks Hello everyone. I need help with the following PHP APP. I am running on (Version PHP 7.2.10) I am trying to have a page table form on table.php pass the input variable of “5-Numbers” to another page called table_results.php I want that variable string of “5-Numbers” to be compared against 4 arrays and output any duplicates found within each of those 4 lists. If nothing is found, I still want some visual output that reads “None found”.
Lets pretend I have the following example .. On table.php, I typed inside my table form the 5-Numbers .. INPUT: 2,15,37,13,28 On table_results.php, the 4 arrays to be compared against my input numbers “ 2,15,37,13,28” are ..
$array_A = array(2,6,8,11,14,18,24); $array_B = array(1,2,9,10,13,14,25,28,); $array_C = array(1,3,7,9,13,15,20,21,24); $array_D = array(4,5,12,22,23,27,28,29);
So my output should read as follows below .. OUTPUT:
TABLE COLUMN 1 COLUMN 2 ROW 1 Matches Found Results .. ROW 2 GROUP A: 2 ROW 3 GROUP B: 2,13,28 ROW 4 GROUP ? 13,15 ROW 5 GROUP ? 28 ROW 6 5#s Input: 2,15,37,13,28
Please let me know if anyone has any suggestions on how to go about it. Thanks. Edited January 1, 2019 by Jayfromsandiego Wanted to include image example This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=323045.0 Hi, okee so I'm new to everything that has to do with scripting, especially when it comes to PHP and stuff, but what is the best way to display information from a table on a page? I'm creating this site where users can post their events, but I want the Location to be based on the Location they inserted during the registration process, so that the location will be displayed directly. How am I able to do that? I've already got an login script, it looks like this: Code: [Select] <?php ob_start(); $host="localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="whats_happening_db"; // Database name $tbl_name="members"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // Define $myusername and $mypassword $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; // To protect MySQL injection (more detail about MySQL injection) $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php" session_register("myusername"); session_register("mypassword"); header("location:membersarea.php?user=$myusername"); } else { echo "Wrong Username or Password"; } ob_end_flush(); ?> Sorry if my English is terrible haha. Dante. So I have a page that displays a table from my database and now I have to create a link that edits the information and saves it back to the database from a page. I have 2 pages: student_man.php which displays the table info and provides the edit link, and then editstudent.php which displays the form etc where you edit the info and submit it. I think my first page is fine, or rather doesn't display any errors. I'm struggling with my second page however, receiving errors and my data that is already in the fields aren't displaying rather the fields are just empty. First time I attempt this just want to know if I am on the right path and what I might doing wrong. Here is my code First page:<?php Code: [Select] <html> <head> <head> <title>Courses</title> <style type="text/css"> #apDiv2 { position:absolute; left:0px; top:0px; width:1024px; height:180px; z-index:2; } </style> </head> <body bgcolor="white"> <?php ?> <div id="apDiv1"> <div id="apDiv2"><img src="Images/Banner.gif" width="1024" height="180" /></div> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <center><p><a href="student_reg.php"> Register a student</a> -- <a href="course_man.php"> Manage courses </a> -- <a href="student_man.php"> Manage student </a> --<a href="list.php"> view registrations </a> </p></center> </div> <br> <br> <p><a href="selectdelstudent.php"> Delete </a> <a href="student_reg.php"> Add </a> </p> <!-- Table for course --> <div id="apdiv3"> <table border=1px noshade="no"> <tr> <td><b> Course Name</b></td> <td><b> Surname</b></td> <td><b> Initials</b></td> <td><b> Full First Name</b></td> <td><b> Title</b></td> <td><b> Maiden or previous surname</b></td> <td><b> Date of birth</b></td> <td><b> Gender</b></td> <td><b> Language of correspondence</b></td> <td><b> Identity number</b></td> <td><b> Cell Phone Number</b></td> <td><b> Fax Code + Number</b></td> <td><b> E-mail Address</b></td> <td><b> Postal address of student</b></td> </tr> </table> </div> <!-- Start of php code for retrieving student information --> <?php include 'includes/config.php'; //connect to database $link=mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); //error check if (!$link) { die('could not connect: ' . mysql_error()); } $db_selected=mysql_select_db(DB_NAME, $link); // error check if (!$db_selected) { die('can\t use ' . DB_NAME . ': ' . mysql_error()); } //query database $query=mysql_query("SELECT * FROM student "); //fetch results and convert to table while ($rows = mysql_fetch_array($query)): echo "<a href=\"editstudent.php?id=" . $rows['sno'] ."\" > edit </a>"; $cname=$rows['cname']; $sname=$rows['sname']; $init=$rows['init']; $fname=$rows['fname']; $title=$rows['title']; $msname=$rows['msname']; $dob=$rows['dob']; $sex=$rows['sex']; $lang=$rows['lang']; $idno=$rows['idno']; $telh=$rows['telh']; $telw=$rows['telw']; $cell=$rows['cel']; $fax=$rows['fax']; $email=$rows['email']; $address=$rows['address']; echo " <table border=1px> <tr> <td>$cname</td> <td>$sname</td> <td>$init</td> <td>$fname</td> <td>$title</td> <td>$msname</td> <td>$dob</td> <td>$sex</td> <td>$idno</td> <td>$telh</td> <td>$telw</td> <td>$cell</td> <td>$fax</td> <td>$email</td> <td>$address</td> </tr> </table>" ; endwhile; ?> </body> </html> ?> Here is my second page where you edit the info: <?php Code: [Select] <?php include 'includes/config.php'; //connect to database $link=mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); //error check if (!$link) { die('could not connect: ' . mysql_error()); } $db_selected=mysql_select_db(DB_NAME, $link); // error check if (!$db_selected) { die('can\t use ' . DB_NAME . ': ' . mysql_error()); } // connected to database if (!isset($_POST['submit'])) { $q = "SELECT * FROM student WHERE ID = $_GET[sno]"; $result = mysql_query($q); $person = mysql_fetch_array($result); } ?> <h1> You are editing a student </h1> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <p>Course name:</p> <INPUT TYPE = "text" name="input1"value="<?php echo $person['cname']; ?>" /> <br> <p>Surname:</p> <INPUT TYPE = "text" name="input2"value="<?php echo $person['sname']; ?>" /> <br> <p>Initials:</p> <INPUT TYPE = "text" name="input3"value="<?php echo $person['init']; ?>" /> <br> <p>Full First Name:</p> <INPUT TYPE = "text" name="input4"value="<?php echo $person['fname']; ?>" /> <br> <p>Title:</p> <INPUT TYPE = "text" name="input5"value="<?php echo $person['title']; ?>" /> <br> <p>Maiden or previous surname:</p> <INPUT TYPE = "text" name="input6"value="<?php echo $person['msname']; ?>" /> <br> <p>Date of Birth:</p> <INPUT TYPE = "text" name="input7"value="<?php echo $person['dob']; ?>" /> <br> <p>Gender:</p> <INPUT TYPE = "text" name="input8"value="<?php echo $person['sex']; ?>" /> <br> <p>Language for correspondence:</p> <INPUT TYPE = "text" name="input9"value="<?php echo $person['lang']; ?>" /> <br> <p>Identity Number:</p> <INPUT TYPE = "text" name="input10"value="<?php echo $person['id']; ?>" /> <br> <p>Home Telephone Code + Number:</p> <INPUT TYPE = "text" name="input11"value="<?php echo $person['telh']; ?>" /> <br> <p>Work Telephone Code + Number:</p> <INPUT TYPE = "text" name="input12"value="<?php echo $person['telw']; ?>" /> <br> <p>Cell Phone Number:</p> <INPUT TYPE = "text" name="input13"value="<?php echo $person['cel']; ?>" /> <br> <p>Fax Code + Number:</p> <INPUT TYPE = "text" name="input14"value="<?php echo $person['fax']; ?>" /> <br> <p>E-mail Address:</p> <INPUT TYPE = "text" name="input15"value="<?php echo $person['email']; ?>" /> <br> <p>Postal Address of student:</p> <INPUT TYPE = "text" name="input16"value="<?php echo $person['address']; ?>" /> <br> <INPUT TYPE = "Submit" name="submit" VALUE = "Submit"/> <input type="hidden" name="sno" value="<?php echo $_GET['sno']; ?>" /> </form> <?php if(isset($_POST['submit'])) { $u = "UPDATE student SET `cname` = '$_POST[input1]' `sname` = '$_POST[input2]' `init` = '$_POST[input3]' `fname` = '$_POST[input4]' `title` = '$_POST[input5]' `msname` = '$_POST[input6]' `dob` = '$_POST[input7]' `sex` = '$_POST[input8]' `lang` = '$_POST[input9]' `idno` ='$_POST[input10]' `telh` = '$_POST[input11]' `telw` = '$_POST[input12]' `cel` = '$_POST[input13]' `fax` = '$_POST[input14]' `email` = '$_POST[input15]' `address` = '$_POST[input16]' WHERE ID = $_POST(sno)"; mysql_query($u) or die(mysql_error()); echo "User has been modified!"; header("Location: index.php"); } ?> ?> On my second page I am receiving the following errors after typing random letters as info into the fields and submitting it: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`sname` = 'sds' `init` = 'gfg' `fname` = 'rtr' `title` = '' `msname`' at line 3 I am creating a stream page that updates automatically without the page reloading by reloading a div on the page using a timer. However, I only want it to run the update and fade in/fade out when there is a new status in the table. I tried doing it through PHP getting the number of rows in the table on the page itself and then checking the number of rows on an action page, however, the number of rows didnt update when the div was reloaded. I then tried doing it using jquery/javscript but had the same problem. How can I acheive this? Thanks in advance Hi, I wonder if I somebody can help me I have three drop down lists which are populated from data thats stored in my sql database. I also have a table which is echoed from the database all on the same page. What i want to do is allow users to select values in the drop down lists which will then echo different results below in the table. Is this possible. So on page load it will show all of the info in the html table. Then when the user changes the drop downs and clicks submit it will change the query to something SELECT dropdown1 value FROM users where Dropdown2 = 1 AND Dropdown3 = 2 etc. Is this possible to display this information on the same page using the dropdown list or does it need to load a different page as the client side is trying to edit a server side script? If its possible please can someone give me an example. Thanks in advance Edd So I have a jobs database with the following columns: id, jobtext, jobdate, and id. This is how it looks right now: http://prahan.com/jobs/display.html.php I have another table called author. In the authorid column in need the results of this query, SELECT name FROM author WHERE id = (SELECT authorid FROM job) , to be displayed for each row. I also want to be able to customize the header title for each column. Thanks in advance! Hey all I'm working on an auction website. I've added a new column to the 'Auctions' table, however the 'sell.php' page now does not work with this new column (I've deleted the column and tested again and it works, so that's definitely the cause). The new column can not be in a separate table as it needs to pull 'id' values from the 'Auctions' table for various functions. My question to you is, is there any PHP snippet I can use to tell sell.php to stop reading the 'Auctions' table once it reaches the column I've added? The new column is called 'shipped' if that's of any relevance. Below is some of the PHP I'm working on on the sell.php page. #//Populate arrays $UPLOADED_PICTURES[] = $file; $UPLOADED_PICTURES_SIZE[] = filesize($image_upload_path.session_id()."/".$file); } } } $_SESSION["UPLOADED_PICTURES"] = $UPLOADED_PICTURES; $_SESSION["UPLOADED_PICTURES_SIZE"] = $UPLOADED_PICTURES_SIZE; $_SESSION["GALLERY_UPDATED"]=true; if($sessionVars['SELL_action']=='edit') { $sessionVars["OLD_GALLERYFEE"] = $SETTINGS["picturesgalleryvalue"] * count($UPLOADED_PICTURES); } else { $sessionVars["OLD_GALLERYFEE"] = 0; } } } } $with_reserve = $sessionVars["SELL_with_reserve"]; $reserve_price = $sessionVars["SELL_reserve_price"]; $minimum_bid = $sessionVars["SELL_minimum_bid"]; $duration_hours = $sessionVars["SELL_duration_hours"]; $duration_minutes = $sessionVars["SELL_duration_minutes"]; $pict_url=$sessionVars["SELL_pict_url"]; $imgtype = $sessionVars["SELL_file_uploaded"]; $title = $sessionVars["SELL_title"]; $description = stripslashes($sessionVars["SELL_description"]); $pict_url = $sessionVars["SELL_pict_url"]; $atype = $sessionVars["SELL_atype"]; $adultonly = $sessionVars["SELL_adultonly"]; $TPL_item_value = $item_value = $sessionVars["SELL_item_value"]; $TPL_number_of_bids =$number_of_bids=$sessionVars["SELL_number_of_bids"]; $TPL_bid_value = $bid_value = $sessionVars["SELL_bid_value"]; $iquantity = $sessionVars["SELL_iquantity"]; $buy_now = $sessionVars["SELL_with_buy_now"]; $buy_now_price = $sessionVars["SELL_buy_now_price"]; $duration = $sessionVars["SELL_duration"]; $duration_second = $sessionVars["SELL_duration_second"]; $minimum_users = $sessionVars["SELL_minimum_users"]; $relist = $sessionVars["SELL_relist"]; $increments = $sessionVars["SELL_increments"]; $customincrement = $sessionVars["SELL_customincrement"]; $international = ($sessionVars["SELL_international"])?"on":""; $sellcat = $_SESSION['sellcat']; $private = $sessionVars["SELL_private"]; if($private != 'y') $private = 'n'; $sendemail = $sessionVars["SELL_sendemail"]; $txt = $sessionVars["SELL_txt"]; $num = $sessionVars["SELL_num"]; $buy_now_only = $sessionVars["SELL_buy_now_only"]; and... $auction_id=$sessionVars['SELL_auction_id']; } elseif ($sessionVars["SELL_action"] == "reopen") { $query = "UPDATE BPLA_auctions set title = '".addslashes($sessionVars["SELL_title"])."', starts = '".$a_starts."', starts_second = '".$a_starts_second."', description = '".addslashes($sessionVars["SELL_description"])."', pict_url = '".addslashes($sessionVars["SELL_pict_url"])."', category = ".$sessionVars["SELL_sellcat"].", minimum_bid = '".$sessionVars["SELL_minimum_bid"]."', reserve_price = '".(($sessionVars["SELL_with_reserve"]=="yes")?$sessionVars["SELL_reserve_price"]:"0")."', buy_now = '".(($sessionVars["SELL_with_buy_now"]=="yes")?$sessionVars["SELL_buy_now_price"]:"0")."', bn_only = '".$sessionVars["SELL_buy_now_only"]."', auction_type = '".$sessionVars["SELL_atype"]."', adultonly = '".$sessionVars["SELL_adultonly"]."', duration = '".$sessionVars["SELL_duration"]."', duration_second = '".$sessionVars["SELL_duration_second"]."', minimum_users = ".intval($sessionVars["SELL_minimum_users"]).", increment = ".doubleval($sessionVars["SELL_customincrement"]).", international = '".(($sessionVars["SELL_international"])?"1":"0")."', ends = '".$a_ends."', ends_second = '".$a_ends_second."', photo_uploaded = ".(($sessionVars["SELL_file_uploaded"])?"1":"0").", quantity = ".$sessionVars["SELL_iquantity"].", relist=".intval($sessionVars["SELL_relist"]).", relisted=0, closed='0', private='n', item_value = '".$sessionVars["SELL_item_value"]."', number_of_bids = '".$sessionVars["SELL_number_of_bids"]."', bid_value = '".$sessionVars["SELL_bid_value"]."', suspended='".$SUSPENDED."',"; $query .= "current_bid=0, num_bids=0, WHERE id = '".$sessionVars["SELL_auction_id"]."'"; $backtoclosed=true; if($BPLowbidAuction_TESTMODE == 'yes'){ echo $ERR = $ERR_9999; }else{ $res=mysql_query($query); if (!$res) { MySQLError($query); exit; } $auction_id=$sessionVars['SELL_auction_id']; $sessionVars["SELL_auction_id_old"]=$auction_id; $query = "DELETE FROM BPLA_bids WHERE auction='$auction_id'"; $res = @mysql_query($query); if(!$res) { MySQLError($query); exit; } Thanks in advance for any help and replies! I'm trying to figure out how I can break a string down if the strings length is longer then lets say 140 characters including white space. At first I was figuring maybe maybe I could do something with explode or implode after I get a get my strings length but the string in question has no static values to them that would let me break it apart or put it back together. Now In most cases I would use substr() to return my 140 characters, however I need to take 140+ and make an array of the extra so I can run a for each on it. I am using this for an SMS app I am helping develop. I know I can limit my the output to only 140, just based on the notion that a single SMS is capped at 140-160 on most carriers. Unfortunately for me thats not the case so I need to break this apart and I am stumped, anyone got any ideas? Hi all, I realised as users register themselves in the registration form, they wrote their comments and experience in the comment box which was provided Example (this is the content which they have written) 'Sentence 1 - Abccafsafsafafasdfafasfafs Sentence 2 - dasddsadsadsadsdaddsda' As you can see, between Sentence 1 and 2 there is a break (space). However when we store it in our database, and generate it out as a webpage, the break (space) is gone, and sentence 1 and 2 merged Example 'Abccafsafsafafasdfafasfafsdasddsadsadsadsdaddsda' My question is, how can we prevent 2 different sentences from merging? Thanks Below is my code and attached it what has been generated after we have posted it in webpage Code: [Select] cho '<div id="panel3">'; echo '<table>'; /***Tutor's Comments***/ echo'<div id="tutor_comments">'; echo '<br/><tr><td class="row_header">Tutor\'s Comments</td></tr>'; if (!empty($row2['tutor_comments'])) { echo '<tr><td>' . $row2['tutor_comments'] . '<br/><br/></td></tr>'; } /***Tutor's Commitments***/ echo '<tr><td class="row_header">Tutor\'s Commitment</td></tr>'; if (!empty($row2['tutor_commitment'])) { echo '<tr><td>' . $row2['tutor_commitment'] . '<br/><br/></td></tr>'; } /***Admin_comments***/ echo '<tr><td class="row_header">Admin\'s Comments</td></tr>'; if (!empty($row2['admin_comments'])) { echo '<tr><td>' . $row2['admin_comments'] . '<br/><br/></td></tr>'; } echo '</table>'; //End of Panel 3's table echo '</div>'; //End of tutor_comments DIV Code: [Select] $result = mysql_query("SHOW COLUMNS FROM ".$table.""); $i = 0; if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_assoc($result)) { $csv_output .= $row['Field'].","; $i++; } } $csv_output .= "\n"; $values = mysql_query("SELECT * FROM ".$table.""); while ($rowr = mysql_fetch_row($values)) { for ($j=0;$j<$i;$j++) { $csv_output .= $rowr[$j].", "; } $csv_output .= "\n"; } print $csv_output; I'm using the above to get a csv output in my browser, but it appears as a string of text eg a1,a2,a3,a4,b1,b2,b3,b4,... I'd like it to appear as a1,a2,a3,a4 b1,b2,b3,b4 c1,c2,c3,c4 Any ideas how? Good morning, I passed a bunch of HTML tags over a function that delete then, keeping just the text between. The problem is, after that all the tags were replaced by line breaks. Something like this before the function: <tr> <td> Text </tr> </td> After the function the 4 tags were correctly removed but instead i receive just the string "Text" I receive 2 line breaks, the "Text" and other 2 line breaks, like this: Text In HTML code this line breaks has no tags like <br> or <p> it's just blanck lines. I need to get just the text, how can I get rid of then? I tried this and also didn't work. $text = str_replace("/n", "", $text ); Thanks Danilo Jr. why is it that when i saved it adds a break tag i dont understhand heres the code i cant find it its only when i save or remove a video and save it it has a break Code: [Select] <?php require "scripts/connect.php"; if($_POST['submitbtn']){ $video1 = mysql_real_escape_string(html_entity_decode($_POST['video1'])); $video2 = mysql_real_escape_string(html_entity_decode($_POST['video2'])); $video3 = mysql_real_escape_string(html_entity_decode($_POST['video3'])); $video4 = mysql_real_escape_string(html_entity_decode($_POST['video4'])); if($video1){ if($video2){ if($video3){ if($video4){ $query = mysql_query("UPDATE videos SET video1='$video1',video2='$video2',video3='$video3',video4='$video4'"); header("location: http://www.mywebsite.com/admin/editvideos"); }else $msg = "PLEASE FILL IN"; }else $msg = "PLEASE FILL IN"; }else $msg = "PLEASE FILL IN"; }else $msg = "PLEASE FILL IN"; } mysql_close(); ?> <?php include "header.php";?> <?php if($email){?> <?php include "inc/nav.php"; ?> <div id="righthomecontent"> <?php require "scripts/connect.php"; $query = mysql_query("SELECT * FROM videos"); $rows = mysql_fetch_assoc($query); $video1 = stripslashes($rows['video1']); $video2 = stripslashes($rows['video2']); $video3 = stripslashes($rows['video3']); $video4 = stripslashes($rows['video4']); mysql_close(); ?> <center>MUST USE THIS IN VIDEOS ?wmode=opaque"</center><br> <center>All videos are Width='220' and Height='240'</center><br> <form class="editvideoform" action="editvideos" method="post"> <table> <tr> <td></td> <td><?php echo $msg;?></td> </tr> <tr> <td>VIDEO 1</td> <td><textarea cols=25 rows=10 name="video1"><?php echo $video1;?></textarea></td> </tr> <tr> <td>VIDEO 2</td> <td><textarea cols=25 rows=10 name="video2"><?php echo $video2;?></textarea></td> </tr> <tr> <td>VIDEO 3</td> <td><textarea cols=25 rows=10 name="video3"><?php echo $video3;?></textarea></td> </tr> <tr> <td>VIDEO 4</td> <td><textarea cols=25 rows=10 name="video4"><?php echo $video4;?></textarea></td> </tr> <tr> <td></td> <td><input type="submit" name="submitbtn" value="SUBMIT" /></td> </tr> </table> </form> </div> <?php } else { echo "<center><h1>PLEASE LOGIN</h1></center>"; } ?> <?php include "footer.php";?> I want to have a line break between the lastname and the age. Please help. echo $line["firstname"].' '.$line["lastname"].' Age is'.$line["age"].'!'; How can i break down strings for example i have a simple search database for products where as a user searches a term this can be one, two three words and so on. I'm using a wildcard; but i want the best way to get the possible search so i would like to break down the string into separate words and then use that to search the database using wildcards is this possible? Thanks for reading. echo '<div class="gamename">'.$values[0].'</div>'; echo '<div class="gameimage"><a href="'.$values[3].'"><img src="'.$values[1].'"></a></div>'; NOW i want 2nd echo under 1st echo. I tried every single <br> combination but no luck Also my 2nd question is: my image and link is a variable, it displays the image but there is something wrong with link. Variable is just like this www.mydomain.com\image\blabla.php but it shows link as==> www.mydomain.com\ instead of what i wrote above. I have a chain of methods, is there anyway to end the chain half way through if some particular event happens? Here is an example (not the best but still an example): Code: [Select] <?php $age = $class->post("age")->callback(funciton(){ global $class; if($class->string() < 18){ // end the execution of the chain, doesn't execute toInt() } })->toInt(); ?> hi i have some troubles to create a new line break for this code: i already tried: Code: [Select] echo "<input type='radio' name='gropu1' value='$id'>$data \n "; // Code: [Select] echo "<input type='radio' name='gropu1' value='$id'>$data.\n "; // Code: [Select] echo "<input type='radio' name='gropu1' value='$id' >$data.'\n'"; what is the correct syntax for that? |