PHP - Help Needed On Php-fpm Configuration
Dear All,
Similar TutorialsGreetings. First time poster looking for some PHP help if it can be provided, because I'm confused as hell. First off, I'll explain my situation. I'm the IT technician of a small business tasked with ensuring the business' computers and website are running in top shape. I originally joined as a Data Entry clerk to post products to the business' website, but got promoted when they original IT technician left town to pursue his PhD. Before he left, he taught me a few things to prepare watching over the website as my new duty, including some PHP and MySQL. Now, a few months after he's left, I have the glorious task of trying to move our website to a new host because we've apparently outgrown our original host's capabilities. And being based on PHP with a MySQL database, it's turning out to be OH-so-fun. So far, I've managed to download our entire website from the old host and given it to our new host to put up as a testing site, to ensure everything works before we switch hosts. And for the most part, a lot of it has come together nicely, but there's still work needed to be done. And thus we come to the problem I hope someone here can help with. Our website has two back-end Admin sections, an older one that used to handle everything, and a newer one that's sleeker but still reads off a lot of data from the older one to work properly. Normally, when you access those sections, you need to log in first. Now, in the testing site, when I access those areas, the header of each of those sections now reads <?= $row[title] ?> and if I attempt to log in as normal, it just flashes back to the login page with the fields now cleared of what I typed in. When I asked about this to see what the problem might be, the new host said it might "at least two misconfigurations on the new server relative to the old server". So, I've been trying to Google for some help with PHP Configuration Functions, but I don't know if what I'm reading will help me fix the problem. Would anyone here happen to know what they might mean in this case, because my knowledge of PHP is fairly limited beyond what I was taught to keep the website in order without considering a host change... Thanks to those who help or can direct me to a place that helps! hi, i have a configuration file with this content for example: test = "100"; teste2 = "300"; now need change the test from 100 to 300, i just want use something like this: function ( "test" , 300 ); how can i do that? thanks for help Hi ,
My site gives a blank page when i click on an article due to insufficient memory. I tried making changes to the php.ini file but the changes are not getting reflected.
Please advice if a server restart is needed for this, how do i go about it?
Thanks in advance
Hi Guys, I'm a bit new to php coding, so dont really know what the best way to code this up. I want to make a router configuration page, such as it shows the link status (ip/gatewatway etc) and also have input selections such as to turn on/off wifi / dhcp etc. Ideally I would like the data stored and written to a text file as the php server is running on a linux arm embedded system. At present I have been able to read back from a text file the corresponding values for each of the status information (these are stored on a seperate line), but I'm having difficulty writing and reading the input selection boxes, such as when the dhcp is disabled I need it to write to a file that its been disabled and refresh the page to allow entry of the static ip box and then when the apply button is pressed the value is written to the file. This may be out of my depth, hopefully someone could give me some pointers. I feel that the text file might not be the best way of storing and recalling values but I don't know of another way. Many Thanks Tim Does any know how to set SMTP Mail Configuration using the gmail account? Every now and then, I experience some strange behavior and eventually trace it back to parse_ini_file's scanner_mode being applicable to some parameter but not another, and am looking for alternatives. Below are several of my thoughts. How do you store configuration settings? Do you use different approaches based on the application, and if so what criteria governs which you use? Keep with a ini file with parse_ini_file. Obviously, not working for me. An ini file but with a class dedicated to ensuring the data is appropriate. Seems like too much duplicating content which will result in errors. YAML. Don't think I want to. XML. Not as readable. In a database. Maybe, but might be harder to manage. Hardcode an array in PHP. Probably not. JSON. I like the idea, but feel comments are important in a config file, and am considering the following: Add extra valid JSON properties which contain comments. Don't like the idea. Use JavaScript's JSON.stringify. Too much mixing technologies. Add comments to the JSON and then strip them using a 3rd party parser such as https://json5.org/ or a little regex. My main issue is inability to auto-format, but this seems viable. Any other ideas?Thanks!
I have a configuration file, and I use parse_ini_file() to parse it into an array at the initial entry point of my script.
I would like the settings to be available to all downstream scripts/methods/functions. Note that my intent is not to change them outside of the configuration file, and ideally they will be readonly, however, if not, I suppose that is okay and I will just be sure not to modify them.
I've read about dependency injection, and while this mostly makes sense, it seems like a lot of script/troubleshooting for little if any value for this scenario.
I've read that global variables are bad (couples your objects to some "god" object, cannot unit test, difficult to troubleshoot, difficult to work with multiple developers, potential conflicts with other classes, namespace pollution), but maybe not for this case?
Another option is defining a bunch of constants to the appropriate values, but this seems redundant.
Or maybe some static class with all the values?
What would be the best way to make configuration settings available to all PHP scripts, functions, and methods? Hi, I've been googling for a while now for an example of how to read, edit and write a configuration file. This part was easy to find... <?php $icon_settings = parse_ini_file("test.desktop"); print_r($icon_settings); ?> ...the above code works great, but how do I edit and write back a configuration file like this... Code: [Select] #!/usr/bin/env xdg-open [Desktop Entry] Version=1.0 Name=Firefox Web Browser Comment=Browse the World Wide Web GenericName=Web Browser Exec=firefox %u Terminal=false X-MultipleArgs=false Type=Application Icon=firefox # ... and so on back to the drive? Thanks. Hi, I don't know if this is even possible, but I need to copy configuration of existing server to my localhost (using XAMPP on windows). I only have full output of phpinfo() function from that server (I don't have access to php.ini), and I would like to change my localhost server to behave exactly like remote one.
Is this even possible? Hey Guys, First Post! Yay I have a problemo, I feel really stupid about having to ask this question. But basically I can't get a new line when I echo output in a script I am writing for my website. Here is the code: echo $newsentry; echo '_______ Read More..'; I tried '\n' I tried using " (double quotes) I have used ' (single quotes) I have positioned the Line Feed '\n' at the begining of an output, and at the end. Neither made any difference. I tried using carriage return '\r' too. Nothing. I haven't coded in PHP for a while, well nothing basic (I know that sounds rediculas but it has been mostly Apps etc, Client Scripts blah blah blah, but I haven't had to echo with a new line for a few years. Probably the last website which I wrote with my friend. So I checked the PHP manual, and I am clearly missing something when I am reading it, I understood it to mean (which as you can see from my code, is what I am currently doing), that you could just somehow type: echo "some string and it carries on to the second line"; However as I first thought, this makes no difference. Could this be a configuration on the Box that hosts this Site?? Sorry for sounding so stupid guys, I appreciate your help. -Craig This topic has been moved to PHP Installation & Configuration. http://www.phpfreaks.com/forums/index.php?topic=326567.0 Hello Forum, please can someone help me solve this error in the code below, thanks Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\XAMPP\xampp\htdocs\testingSite\addtobasket.php on line 10 Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\XAMPP\xampp\htdocs\testingSite\addtobasket.php on line 11 <?php session_start(); require("db.php"); require("function.php"); $validid = pf_validate_number($_GET['id'], "redirect", $config_basedir); $prodsql = "SELECT * FROM products WHERE id =" .$_GET['id'] . "'"; $prodres = mysql_query($prodsql); $numrows = mysql_num_rows($prodres); $prodrow = mysql_fetch_assoc($prodres); if($numrows == 0) { header("Location: ". $config_basedir); } else { if($_POST['submit']) { if($_SESSION['SESS_ORDERNUM']) { $itemsql = "INSERT INTO orderitems(order_id, product_id, quantity) VALUES (" . $_SESSION['SESS_ORDERNUM'] . "," . $_GET['id'] . "," . $_POST['amountBox'] .")"; mysql_query($itemsql); } else { if($_SESSION['SESSION_LOGGEDIN']) { $sql = "INSERT INTO orders(customer_id, registered, date) VALUES (" . $_SESSION['SESS_USERID'] . ", 1, NOW())"; mysql_query($sql); session_register("SESS_ORDERNUM"); $_SESSION['SESS_ORDERNUM'] = mysql_insert_id(); $itemsql = "INSERT INTO orderitems(order_id, product_id, quantity) VALUES (" . $_SESSION['SESS_ORDERNUM'] .",". $_GET['id'] . "," . $_POST['amountBox'] . ")"; mysql_query($itemsql); } else { $sql = "INSERT INTO orders(registered, date, session) VALUES(" ."o, NOW(),'" . session_id() . "')"; mysql_query($sql); session_registered("SESS_ORDERNUM"); $_SESSION['SESS_ORDERNUM'] = mysql_insert_id(); $itemsql = "INSERT INTO orderitems(order_id, product_id, quantity) VALUES(" . $_SESSION['SESS_ORDERNUM'] . "," .$_GET['id'] . "," . $_POST['amountBox'] . ")"; mysql_query($itemsql); } } $totalprice = $prodrow['price'] * $_POST['amountBox']; $updsql = "UPDATE orders SET total + ". $totalprice . " WHERE id = " . $_SESSION['SESS_ORDERNUM'] . ";"; mysql_query($updres); header("Location: " . $config_basedir . "showcart.php"); } else { require("header.php"); echo "<form action='addtobasket.php?id=" .$_GET['id'] . "' method='POST'>"; echo "<table cellpadding='10'>"; echo "<tr>"; if(empty($prodrow['image'])) { echo "<td><img src='./images.dummy.jpg' width='50' alt='" . $prodrow['name'] . "'></td>"; } else { echo "<td><img src=' ./images/" . $prodrow['image'] . "' width='50' alt='" . $prodrow['name'] . "'></td>"; } echo "<td>" . $prodrow['name'] ."</td>"; echo "<td>Select Quantity <select name='amountBox'>"; for($i=1;$i<=100;$i++) { echo "<option>" . $i . "</option>"; } echo "</select></td>"; echo "<td><strong>£" . sprintf('%.2f', $prodrow['price']) . "</strong></td>"; echo "<td><input type='submit' name='submit' value='Add to basket'></td>"; echo "</tr>"; echo "</table>"; echo "<form>"; } } require("footer.php"); ?> i have a piece of code which subtracts credits every time a button is clicked. the original code works fine. I have since added a bonus_credit column, where i want it to function like this. if buy_credit = 0 and bonus_credit>0 then subtract from the bonus credit, but still do everything else its supposed to do.. here is the original code i had $selRes=mysql_query("SELECT buy_credit from user where id='".$hb_id."' and buy_credit>0"); if(mysql_affected_rows()>0) { $b_comm=0; $bc_updqry=mysql_query("UPDATE user set buy_credit=buy_credit-1 where id='".$hb_id."'"); $updqry=mysql_query("UPDATE cars set b_fee_paid_status='1' where id='".$aid."'"); } here is my modified code, but it doesn't seem to subtract from buy_credit if buy_credit is >0.. it should only kick in the bonus_credit usage if buy_credit is 0 $selRes=mysql_query("SELECT buy_credit,bonus_credit from user where id='".$hb_id."' and buy_credit>0 OR bonus_credit>0"); if(mysql_affected_rows()>0) { $b_comm=0; if($selRes['buy_credit']!=0) { $bc_updqry=mysql_query("UPDATE user set buy_credit=buy_credit-1 where id='".$hb_id."'"); } else { $bc_updqry=mysql_query("UPDATE user set bonus_credit=bonus_credit-1 where id='".$hb_id."'"); } $updqry=mysql_query("UPDATE cars set b_fee_paid_status='1' where id='".$aid."'"); } your help is appreciated. Hello i have coded a script that checks the post values then updates db recoreds thing is. i have this line of code if($name && $price && $ship && $paypal && $des && $cato_id !== ""){ do code }else{ do this } when the client enters 0 in the ship and price the do code does not get excuted how can i solve this problem thanks <?php # Script 10.3 - upload_image.php // This page is for editing a product. require_once(MYSQL);; // Check for a valid product ID, through GET or POST: if ( (isset($_GET['id'])) && (is_numeric($_GET['id'])) ) { $id = $_GET['id']; // Make the query: $q = "SELECT name, price, ship, paypal, descr FROM products WHERE product_id='$id' LIMIT 1"; $r = mysqli_query ($dbc, $q); if(mysqli_affected_rows($dbc) == 1) {//Ran Ok ready to delete file $row = mysqli_fetch_array ($r, MYSQLI_ASSOC); } } else { die('<p class="error">Sorry this page is not available or has been accessed in error</p>'); } // Check if the form has been submitted: if (isset($_POST['submitted'])) { require_once(MYSQL); // Trim all the incoming data: $trimmed = array_map('trim', $_POST); // Assume invalid values: $name = $price = $ship = $paypal = $des = $cato_id = FALSE; // Check for a product name: if (preg_match ('/^[A-Z \'.-]{2,20}$/i', $trimmed['name'])) { $name = mysqli_real_escape_string ($dbc, $trimmed['name']); } else { echo '<p class="error">Please enter a product name</p>'; } // Check for a price if (is_numeric($trimmed['price'])) { $price = mysqli_real_escape_string ($dbc, $trimmed['price']); } else { echo '<p class="error">Please enter a price</p>'; } // Check for a price if (is_numeric($trimmed['shipping_cost'])) { $ship = mysqli_real_escape_string ($dbc, $trimmed['shipping_cost']); } else { echo '<p class="error">Please enter a shipping cost</p>'; } // Check for paypal code: if ($_POST['paypal']) { $paypal = mysqli_real_escape_string ($dbc, $trimmed['paypal']); } else { echo '<p class="error">Please enter the paypal code</p>'; } // Check for product description: if ($_POST['product_des']) { $des = mysqli_real_escape_string ($dbc, $trimmed['product_des']); } else { echo '<p class="error">Please enter a product description</p>'; } // Check for product description: if ($_POST['cato_id']) { $cato_id = mysqli_real_escape_string ($dbc, $trimmed['cato_id']); } else { echo '<p class="error">Please Select a category</p>'; } if ($name && $price && $ship && $paypal && $des && $cato_id !== "") { // If everything's OK... $q = "UPDATE products SET name='$name', price='$price', ship='$ship', paypal='$paypal', descr='$des', cato='$cato_id' WHERE product_id='$id'"; $r = mysqli_query ($dbc, $q) or trigger_error("Query: $q\n<br />MySQL Error: " . mysqli_error($dbc)); echo '<p class="success"><em>The Product Information has Been Updated</em></p>'; } if($_POST['oldimage'] == 0){ // Check for an uploaded file: if (isset($_FILES['upload'])) { // Validate the type. Should be JPEG or PNG. $allowed = array ('image/pjpeg', 'image/jpeg', 'image/JPG', 'image/X-PNG', 'image/PNG', 'image/png', 'image/x-png'); if (in_array($_FILES['upload']['type'], $allowed)) { function findexts ($filename) { $filename = strtolower($filename) ; $exts = split("[/\\.]", $filename) ; $n = count($exts)-1; $exts = $exts[$n]; return $exts; } //This applies the function to our file $ext = findexts ($_FILES['upload']['name']); //This line assigns a random number to a variable. You could also use a timestamp here if you prefer. $timestamp = time(); //This takes the random number (or timestamp) you generated and adds a . on the end, so it is ready of the file extension to be appended. $default_name = $timestamp."."; //This assigns the subdirectory you want to save into... make sure it exists! $target = TARGET; $image = "/photos/"; //This combines the directory, the random file name, and the extension $target = $target . $default_name.$ext; $image = $image . $default_name.$ext; // Move the file over. if (move_uploaded_file ($_FILES['upload']['tmp_name'], "$target")) { // Make the query: $q = "SELECT image FROM products WHERE product_id='$id' LIMIT 1"; $r = @mysqli_query ($dbc, $q); if(mysqli_affected_rows($dbc) == 1) {//Ran Ok ready to delete file $row = @mysqli_fetch_array ($r, MYSQLI_NUM); $q = "UPDATE products SET image='$image' WHERE product_id='$id'"; $r = @mysqli_query ($dbc, $q); //Delete from file $myFile = DELPATH . $row[0]; if (file_exists($myFile)) { //Delete from file if(unlink($myFile)){ echo "<p class=\"success\">File: $row[0] has been successfully deleted</p>"; } } echo '<p class="success"><em>The Product Image has Been Changed</em></p>'; } } // End of move... IF. } else { // Invalid type. echo '<p class="error">Please upload a JPEG or PNG image.</p>'; } // Check for an error: if ($_FILES['upload']['error'] > 0) { echo '<p class="error">The file could not be uploaded because: <strong>'; // Print a message based upon the error. switch ($_FILES['upload']['error']) { case 1: print 'The file exceeds the upload_max_filesize setting in php.ini.'; break; case 2: print 'The file exceeds the MAX_FILE_SIZE setting in the HTML form.'; break; case 3: print 'The file was only partially uploaded.'; break; case 4: print 'No file was uploaded.'; break; case 6: print 'No temporary folder was available.'; break; case 7: print 'Unable to write to the disk.'; break; case 8: print 'File upload stopped.'; break; default: print 'A system error occurred.'; break; } // End of switch. print '</strong></p>'; } // End of error IF. // Delete the file if it still exists: if (file_exists ($_FILES['upload']['tmp_name']) && is_file($_FILES['upload']['tmp_name']) ) { unlink ($_FILES['upload']['tmp_name']); } } // End of isset($_FILES['upload']) IF. } } Hello, I'm working on a project that will let users access a website to view results. I getting via a FTP server CSV files. Files look like that (in French): "ARTICLES; BOISSONS 5.50% ; 1; ORANGINA ; 2.50; 2; PERRIER ; 5.00; 2; SCHWEPPES ; 5.00; ----------------------------------------; 5; BOISSONS 5.50% ; 12.50; RATIO %; 6.94; BOISSONS 19.60% ; 4; PELFORTH ; 10.00; 1; CHIVAS ; 7.00; 1; LIQUEUR ; 5.50; ----------------------------------------; 6; BOISSONS 19.60% ; 22.50; RATIO %; 12.50; RESTAURANT ; 1; BOUILLON POT AU FEU ; 7.00; 2; JAMBON D'AUVERGNE ; 20.00; 2; TERRINE PIED DE PORC; 16.00; 1; CASSOULET ; 20.00; 2; CONFIT DE CANARD ; 46.00; 1; CUISSE DE LAPIN ; 18.00; 1; MOURTAYROL ; 18.00; ----------------------------------------; 10; RESTAURANT ; 145.00; RATIO %; 80.56; ----------------------------------------; TOTAL ; ARTICLES ; 180.00; ------------------------------------------; ------------------------------------------; ------------------------------------------; REGLEMENTS; 2; ESPECES ; 109.50; 1; CARTE ; 70.50; ------------------------------------------; TOTAL ; REGLEMENTS; 180.00;" Basically, I'm trying to write code to "sort" each categorie (ARTICLES, REGLEMENTS....) Here is what I'd like to get: A B C D E ARTICLES; BOISSONS 5.50% ; 1; ORANGINA ; 2; PERRIER ; 2; SCHWEPPES ; BOISSONS 19.60% ; 4; PELFORTH ; 1; CHIVAS ; 1; LIQUEUR ; RESTAURANT ; 1; BOUILLON POT AU FEU ; 2; JAMBON DE DINDE ; 2; TERRINE PIED DE PORC; 1; CASSOULET ; 2; CONFIT DE CANARD ; 1; CUISSE DE LAPIN ; 1; MOURTAYROL ; TOTAL ; 5; BOISSONS 5.50% ; 12.50; 6; BOISSONS 19.60% ; 22.50; 10; RESTAURANT ; 145.00; REGLEMENTS; 2; ESPECES ; 109.50; 1; CARTE ; 70.50; A, B, D only names C, E only numbers These datas will be used to generate pie charts Thanks for your attention Helo dear people, I need some halp with mine script. This is part of it that works: function msan_getxmlinfo() { //global $local; //msan_download(); $path = dirname(__FILE__).'/xml/pricelist.xml'; $doc = new DOMDocument(); $doc->load($path); $msan = $doc->getElementsByTagName( "Table" ); $result = array(); foreach( $msan as $table ) { $codes = $table->getElementsByTagName( "ProductCode" ); $code = $codes->item(0)->nodeValue; $prices = $table->getElementsByTagName( "ProductPartnerPrice" ); $price = $prices->item(0)->nodeValue; $price = sprintf('%6f',$price); $availables = $table->getElementsByTagName( "ProductAvailability" ); $available = $availables->item(0)->nodeValue; $result[$code] = array('code'=>$code,'price'=>$price,'available'=>$available); } //echo "<pre>"; //print_r($result); //@unlink($path); return $result; } But now i need to insert one more element called "ProductDiscount" And aditional condition for proper price setting related so that when "ProductDiscount" is 0 (zero) then increase price by 3% and if theres any other value than 0 (zero) leave price as is. I was trying somthing like this but i cant get price increase: function msan_getxmlinfo() { $path = dirname(__FILE__).'/xml/pricelist.xml'; $doc = new DOMDocument(); $doc->load($path); $msan = $doc->getElementsByTagName( "Table" ); $result = array(); foreach( $msan as $table ) { $codes = $table->getElementsByTagName( "ProductCode" ); $code = $codes->item(0)->nodeValue; $prices = $table->getElementsByTagName( "ProductPartnerPrice" ); $price = $prices->item(0)->nodeValue; $discounts = $table->getElementsByTagName( "ProductDiscount"); if($discounts->item(0)=="0") { $price = $price*1.03; } else { $price = $prices->item(0)->nodeValue; } $price = sprintf('%6f',$price); $availables = $table->getElementsByTagName( "ProductAvailability" ); $available = $availables->item(0)->nodeValue; $result[$code] = array('code'=>$code,'price'=>$price,'available'=>$available,'discount'=>$discount); } return $result; } Help needed! Hi I am new here and I am not a PHP specialist. I run a website (www.theowl.com) and last week I upgraded from PHP 4.X to 5.x on the Namesco server. Everything worked except one thing.... I commissioned an EDI link to DHL, and this was setup using PHP FTP. This system works automatically plus I have a manual link to trigger orders. Since upgrading PHP the automatic process has stopped but the manual process still works fine. Would anybody be able to help. I have attached what I think is the correct file. I am happy to pay for peoples time. I have a form with dynamic text boxes that have dynamic names (i.e., TextBox1, TextBox2, etc.). How do I get those variables passed into php? I have tried and tried...even googled it, with no solid luck. Any help, immediately, would be so much appreciated. Here's my code snippet. Code: [Select] if(preg_match("/^[ a-zA-Z1-42]+/", $_POST['name'])){ $name=$_POST['name']; $namer=$name; $result = mysql_query("select `resource` from resources where `resource_id` =" .$namer. "ORDER BY `resource_id` ASC "); echo "<br/>The following nations have " .$namer. " as a resource\n"; //-query the database table $sql="SELECT id, nation_id, ruler, resource1, resource2 FROM TS1 WHERE resource1 LIKE '%" . $name . "%' OR resource2 LIKE '%" . $name ."%'"; //-run the query against the mysql query function $result=mysql_query($sql); //-create while loop and loop through result set while($row=mysql_fetch_array($result)){ $ID=$row['id']; $Ruler=$row['ruler']; //-display the result of the array echo "<ul>\n"; echo "<li>" . "<a href=\"searcher.php?id=$ID\">" .$Ruler. "</a></li>\n"; echo "</ul>"; } } else{ echo "<p>Please enter a search query</p>"; } } } Basically I have a number that's posted from a form field from another page to this page. It displays correctly on the results page but what i'm trying to do now is get that number to change based on the query at the top '' $result = mysql_query("select `resource` from resources where `resource_id` =" .$namer. "ORDER BY `resource_id` ASC "); " So if the number 3 (which is in the `resource_id` column) was posted it will display a result (which is in the `resource` column). But it just seems that the query isn't going through and it continues to display the 3 which was originally posted instead of changing 3 to a number in the database. I was thinking of performing a while loop so it just just displays the result of the query.. something like this: Code: [Select] $name=$_POST['name']; $namer=$name; $result = mysql_query("select `resource` from resources where `resource_id` =" .$namer. "ORDER BY `resource_id` ASC "); while($row = mysql_fetch_array($result)) { echo "<br/>The following nations have " . $row['resource'] . " as a resource\n"; }But that seems to have more problems as it doesn't display anything at all, not even the original number I had. I don't think it's a big problem.. Maybe something i've just overlooked? okay so i need this same logo to be on the other page..how do i do it.. this is code of the logo page.. Code: [Select] <? if(isset($_GET[ttid])) { $ttid = $_GET[ttid]; } $connection=mysql_connect("$server", "$username", "$password") or die("Could not establish connection"); mysql_select_db($database_name, $connection) or die ("Could not select database"); $query = "select master_event.* , (DATE_FORMAT(event_datefrom, '%d %M %Y')) as datefrom, (DATE_FORMAT(event_dateto, '%d %M %Y')) as dateto, ucase(event_name) as eventname from master_event where master_event.event_id = '$ttid '"; $result=mysql_query($query); while($row = mysql_fetch_array($result)){ $eventname = $row['eventname']; $eventdesc = $row['event_desc']; //$companydescription = $row['company_description']; $eventvenue = $row['event_venue']; $eventfee = $row['event_fee']; $datefrom = $row['datefrom']; $dateto = $row['dateto']; echo "<font color='#000000' face='arial' ><b> $eventname </b> </font> <br>"; echo "<font color='#000000' face='arial' ><i>Date</i> : $datefrom - $dateto <br>"; echo "<i>Venue</i> : $eventvenue <br>"; $querypstype = "SELECT DISTINCT master_pstype.pstype_id, pstype_desc FROM master_pstype INNER JOIN master_psevent ON master_psevent.pstype_id= master_pstype.pstype_id where master_psevent.event_id = '$ttid' ORDER BY pstype_order"; $resultpstype=mysql_query($querypstype); while($rowpstype = mysql_fetch_array($resultpstype)){ $pstypeid = $rowpstype['pstype_id']; $pstypedesc = $rowpstype['pstype_desc']; echo "<br><font color='#8B3A3A' size='1' face='georgia' ><b><i>$pstypedesc</i></b></font> <br>"; $queryps = "SELECT master_psevent.*, pstype_desc, company_name, company_link, company_description, logo_filename FROM master_psevent LEFT JOIN master_pstype ON master_psevent.pstype_id = master_pstype.pstype_id LEFT JOIN master_ps ON master_ps.ps_id = master_psevent.ps_id WHERE master_psevent.event_id = '$ttid' and master_pstype.pstype_id= '$pstypeid' ORDER BY pstype_desc,company_name "; echo $queryps; $resultps=mysql_query($queryps); while($rowps = mysql_fetch_array($resultps)){ $companyname = $rowps['company_name']; $companyid = $rowps['ps_id']; $companylinkori = $rowps['company_link']; $companydescription = $rowps['company_description']; $logopath = $rowps['logo_filename']; $describelink = "index.php?view=describe&ttid=$ttid&pstypeid=$pstypeid&psid=$companyid"; if(!empty($companydescription)){ echo "<a href=\"$describelink\" target=\"_blank\"><img src=".$logo_dir."/".$logopath." width=\"15%\" border=\"0\"></a>"; } else { echo "<a href=\"$describelink\" target=\"_blank\"><img src=".$logo_dir."/".$logopath." width=\"15%\" border=\"0\"></a>"; } } } } ?> i need to put the logo script on this page without removing other data..just wanna add the logo in it..where do i alter? Code: [Select] <? $monthname=$_POST['month']; if (isset($_GET['np'])){ $num_pages=$_GET['np']; } else { if($searchtype == 'yes') if ($monthname=="All" || $monthname=="") { $query = "SELECT count(*) FROM master_event LEFT JOIN master_type ON master_type.type_id = master_event.type_id where isupcomingevent = 1 order by event_datefrom desc"; }else { $query = "SELECT count(*) FROM master_event LEFT JOIN master_type ON master_type.type_id = master_event.type_id where isupcomingevent = 1 AND MONTHNAME(event_datefrom) = '$monthname' order by event_datefrom desc"; } else if ($monthname=="All" || $monthname=="") { $query = "Select count(*) FROM master_event LEFT JOIN master_type ON master_type.type_id = master_event.type_id where isupcomingevent = 1 order by event_datefrom desc"; }else { $query = "Select count(*) FROM master_event LEFT JOIN master_type ON master_type.type_id = master_event.type_id where isupcomingevent = 1 AND MONTHNAME(event_datefrom) = '$monthname' order by event_datefrom desc"; } $result=mysql_query($query); $row=mysql_fetch_array($result, MYSQL_NUM); $num_records=$row[0]; if ($num_records > $displayhome){ $num_pages=ceil($num_records/$displayhome); } else { $num_pages=1; } } if (isset($_GET['s'])){ $start=$_GET['s']; } else { $start=0; } if ($monthname=="All" || $monthname=="") { $query = "SELECT master_event.*,master_type.type_name, DATE_FORMAT(event_datefrom, '%d %b %y') as datefrom, DATE_FORMAT(event_dateto, '%d %b %y') as dateto, event_venue, (event_name) as eventname FROM master_event LEFT JOIN master_type ON master_type.type_id = master_event.type_id where isupcomingevent = 1 order by event_datefrom asc LIMIT $start, $displayhome"; }else { $query = "SELECT master_event.*,master_type.type_name, DATE_FORMAT(event_datefrom, '%d %b %y') as datefrom, DATE_FORMAT(event_dateto, '%d %b %y') as dateto, event_venue, (event_name) as eventname FROM master_event LEFT JOIN master_type ON master_type.type_id = master_event.type_id where isupcomingevent = 1 AND MONTHNAME(event_datefrom) = '$monthname' order by event_datefrom asc LIMIT $start, $displayhome"; } $result = mysql_query($query); $bg='#e5e5e5'; while($row = mysql_fetch_array($result)){ $eventid = $row['event_id']; $eventname = str_replace("", "", $row['eventname']); $eventdatefrom = $row['datefrom']; $eventdateto = $row['dateto']; $event_venue = $row['event_venue']; $event_desc = $row['event_desc']; $speakerlist = $row['speakerlist']; $showline1 = ""; $showpros =""; $showline2 = ""; $showreg =""; $showline3 = ""; $showps =""; $showline4 = ""; $showtestimonial =""; $showline5 = ""; $showsp =""; $showline6 = ""; $showsl =""; if ($eventdatefrom ==$eventdateto) { $eventdate = $eventdatefrom; } else { $eventdate = $eventdatefrom . " - " . $eventdateto; } $querypros="select count(*) as proscount from master_prospectus where event_id ='$eventid' "; $resultpros = mysql_query($querypros); while($rowpros = mysql_fetch_array($resultpros)){ $proscount = $rowpros['proscount']; if ($proscount > 0) { $showline1 = "|"; $showpros ="Request Brochure"; } } $queryreg="select (CASE WHEN event_dateto >= NOW() THEN 'valid' ELSE 'invalid' END) AS validreg from master_event where event_id ='$eventid' "; $resultreg = mysql_query($queryreg); while($rowreg = mysql_fetch_array($resultreg)){ $validreg = $rowreg['validreg']; if ($validreg == "valid") { $showline2 = "|"; $showreg ="Online Registration"; } } $queryps="select count(*) as pscount from master_psevent where event_id ='$eventid' "; $resultps = mysql_query($queryps); while($rowps = mysql_fetch_array($resultps)){ $pscount = $rowps['pscount']; if ($pscount > 0) { $showline3 = "|"; $showps ="Partner & Sponsor"; } } $querytesm="select count(*) as tesmcount from master_testimonial where event_id ='$eventid' "; $resulttesm = mysql_query($querytesm); while($rowtesm = mysql_fetch_array($resulttesm)){ $tesmcount = $rowtesm['tesmcount']; if ($tesmcount > 0) { $showline4 = "|"; $showtestimonial ="Testimonial"; } } $querysp="select count(*) as spcount from master_speakernote where event_id ='$eventid' "; $resultsp = mysql_query($querysp); while($rowsp = mysql_fetch_array($resultsp)){ $spcount = $rowsp['spcount']; if ($spcount > 0) { $showline5 = "|"; $showsp ="Speaker Notes"; } } if ($speakerlist <> '') { $showline6 = "|"; $showsl ="Speaker List"; } echo "<tr><p style=\"font-size:small;\"> <td width='' ><img src='images/search.png' alt='tooltips' ></img> <a href='index.php?view=event&content=tips&ttid=$eventid' title ='$eventname' class=\"fancybox fancybox.iframe\" style=\"color:#104E8B;text-decoration: none; \" ><strong><font size='2' face='Segoe UI' >$eventname</font></strong></a><br> <font color='#000000' size='2' face='arial' >Date : $eventdate <br> Venue : $event_venue<br></font> <table style=\"text-align: left; width: 400px; height: 92px;\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\"> <tbody> <tr> <td></td> <td style=\"text-align: justify; color: #000000;\"> <font color='#000000' size='2' face='arial' > $event_desc</font></td> <td></td> </tr> </tbody> </table> <font color='#919191' size='1' face='arial' ><b> <a href='index.php?view=prospectus®rq=$eventid' title ='Request Brochure...' >$showpros</a> <b>$showline1</b> <a href='index.php?view=registration®rq=$eventid' title ='Online Registration...' > $showreg </a> <b>$showline2</b> <a href='index.php?view=event&content=psevent&ttid=$eventid' title ='Sponsor & Partner...' class='fancybox fancybox.iframe' >$showps</a> <b>$showline3</b> <a href='index.php?view=event&content=tesm&ttid=$eventid' title ='Testimonial...' class='fancybox fancybox.iframe' >$showtestimonial</a> <b>$showline4</b> <a href='index.php?view=spl&splid=$eventid' > $showsp</a><b>$showline5</b> <a href='index.php?view=event&content=speaker&ttid=$eventid' title ='$eventname' class='fancybox fancybox.iframe' > $showsl</a></font><br><br></td> </p></tr></b></font> "; } if ($eventid=="") { echo "No Records Found."; } echo "<td><p style=\"font-size:1;\">"; echo "<br>"; if ($num_pages > 1) { $current_page = ($start/$displayhome) + 1; if ($current_page != 1) { echo '<a href="index.php?view=home&content=list&s=' . ($start - $displayhome) . '&np=' . $num_pages . '#a" class="style1" style="color:#4F94CD;text-decoration: none;">Previous</a> ';} for ($i = 1; $i <= $num_pages; $i++) { if ($i != $current_page) { echo '<a href="index.php?view=home&content=list&s=' . (($displayhome * ($i - 1))) . '&np=' . $num_pages . '#a" class="style1" style="color:#4F94CD;text-decoration: none;">' . $i . '</a> '; } else { echo '<font face="arial" size="2">'; echo $i . '</font> ';} } if ($current_page != $num_pages) { echo '<a href="index.php?view=home&content=list&s=' . ($start + $displayhome) . '&np=' . $num_pages . '#a" class="style1" style="color:#4F94CD;text-decoration: none;">Next</a>';} } echo "</p></td>"; ?> </tr> </div> </form> |