PHP - Php Coding Help Needed
Hay phpeoples (:
I'm new around these parts and I'm looking for a bit of help. I'm trying to answer the following: Quote Upload task8.htm to your web site (found in the zip file you downloaded for this prac set) containing a form with a textbox to enter a customer id, a submit button and a reset button. Create the PHP page named task8.php. This page is the action of task8.htm and will receive the customer ID from the task8.htm page when it submits. Based on that submitted data task8.php should extract the order number, order date, and the shipped field for all orders placed by that customer. Sort the results in ascending order of the order date. Display the results in an appropriate table. Test the PHP script by entering a valid customer id (see your output from task 3 for the customer ids) in the text box of the form and then click submit. Verify that the results you obtain are correct by comparing the resulting data with that obtained from the tables in task 4. Change your SQL query if the data is not correct. Test the script again but this time use a customer id that does not exist. What happens? Modify your task8.php script to better handle this situation with an appropriate error message instead of displaying the table heading. Verify your results. NB: when testing try several valid customer IDs to ensure that the results are correct (never assume that just because you get output that the results are correct). this is my current HTML code: Code: [Select] <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Prac3 Task 8</title> </head> <body> <h1>Task 8</h1> <!-- for the purpose of this and subseqent tasks DO NOT modify the method of this form --> <form id="customerform" action="task8.php" method="get"> <p>please fill in the following form</p> <p>Customer ID: <input type="text" name="custID"/><br/> <p><input type="submit" value="Submit"> <input type="reset" value="Reset"></p> </form> </body> </html> and this is my current php code: Code: [Select] <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Prac 3 Task 3</title> </head> <body> <?php $conn = mysql_connect("localhost", "twastudent", "prac3"); mysql_select_db("warehouse", $conn) or die ('Database not found ' . mysql_error() ); $sql = "select * from orders"; $rs = mysql_query($sql, $conn) or die ('Problem with query' . mysql_error()); ?> <?php $custid = $_GET["custID"]; ?> <?php $row= mysql_fetch_array($rs); if ($custid == $row) ?> <table border="1" summary="Customer Details"> <tr> <th>cID</th> <th>Order number</th> <th>Order Date</th> <th>Shipped</th> </tr> <?php { ?> <tr> <td><?php echo $row["customerID"] ?></td> <td><?php echo $row["orderNumber"] ?></td> <td><?php echo $row["orderDate"]?></td> <td><?php echo $row["shipped"]?></td> </tr> <?php } mysql_close($conn); ?> </table></body></html> Currently it does not show me the records for the number that I type in. Similar TutorialsHello Everyone, I want to create my own Mafia game such as, "Infamous Gangsters" have i come to the right place Basically im new to PHP coding and i want to know a list of things before i start to learn 1.) Does it cost to create a website such as: Infamousgangsters.com? 2.) How long does it take to learn PHP coding before i have enough experience to create one? 3) Does anyone have any useful documents on PHP coding which i can read to learn basic knowledge? Many Thanks, Providence Hello.
I'm in need of help when it comes to page rendering, is it good practice to have own html file for each controller and controller->method OR 1 view file for each controller and then dynamically change content depending on the method?
My structure is like so:
controllers methods
-------------
services-> repair, car glass.....
info-> contact, about me.....
What is the best or good practice to handle the content in the view? The content is always the same.
Thanks in advance.
Hi All, I am trying create 4 dropdowns and load the values based on the value selected in the previous dropdown. I am able to do this for 3 dropdowns, but for the fourth dropdown I am no able to populate the value. Could someone help me out with this please? --------------------------------------- ajaxData_1.php <?php // Include the database config file include_once 'dbconfig_1.php'; if(!empty($_POST["solutions_id"])){ // Fetch state data based on the specific country $query = "SELECT * FROM releases WHERE solutions_id = ".$_POST['solutions_id']; $result = $db->query($query); if($result->num_rows > 0){ echo '<option value="">Select release</option>'; while($row = $result->fetch_assoc()){ echo '<option value="'.$row['releases_id'].'">'.$row['releases_name'].'</option>'; } } else{ echo '<option value="">Release not available</option>'; } } elseif(!empty($_POST["releases_id"])){ $query = "SELECT * FROM versions WHERE releases_id = ".$_POST['releases_id'].""; $result = $db->query($query); if($result->num_rows > 0){ echo '<option value="">Select version</option>'; while($row = $result->fetch_assoc()){ echo '<option value="'.$row['version_id'].'">'.$row['supported_version'].'</option>'; } } else{ echo '<option value="">Version not available</option>'; } } elseif(!empty($_POST["versions_id"])) { $query = "SELECT * FROM platforms WHERE version_id = ".$_POST['version_id'].""; $result = $db->query($query); if($result->num_rows > 0){ echo '<option value="">Select Version</option>'; while($row = $result->fetch_assoc()){ echo '<option value="'.$row['platforms_id'].'">'.$row['platforms_name'].'</option>'; } } else{ echo '<option value="">Platform not available</option>'; } } ?> <?php if(isset($_POST['submit'])) { echo 'Selected Solution ID: '.$_POST['solution']; echo 'Selected Release ID: '.$_POST['release']; echo 'Selected Version ID: '.$_POST['version']; echo 'Selected Platform ID: '.$_POST['platform']; } ?>
Index_3.php <!DOCTYPE html> <html> <head> <title style="color: 000000">Solution Compatibility Matrix</title> <style> select { padding: 12px; min-width:280px; margin-top:10px; } .san{ width:280px; margin:0 auto; margin-top:90px; background-color:#FFFFFF; padding:55px; color: 000000; } label { color:#000000; margin-bottom:25px; } html{ background-color: #3399CC; } </style> </head> <body> </body> </html>
Thanks, Arun Edited April 23, 2020 by cyberRobotAdded code tags Hi All I am fairly new to the PHP world so please excuse my ignorance. (I am trying!) Basically I bought a commercially available PHP script and created my own script to work alongside the bought one. What happened then is that the developers of the script I bought released a new version of the software. My script no longer works and is throwing up the following error PHP Fatal error: Using $this when not in object context in C:\wamp\www\classifieds\system\core\System.php on line 175 I've worked out that the script fails on this line, in the new version of the software. $dbhost = System::getSystemSettings('DBHOST'); On review of the commercial script's coding, I noticed that where the old version used the syntax above, the new version uses a syntax as shown below $this->appContext->getSystemSettings('DBHOST'); So I went and modified my script (mismatched.php) to read as follows $dbhost = $this->appContext->getSystemSettings('DBHOST'); But im now getting the following errors PHP Parse error: syntax error, unexpected T_REQUIRE_ONCE, expecting T_FUNCTION in C:\wamp\www\classifieds\admin\mismatched.php on line 5 I'd appreciate any ideas you may have that could help me get my script (mismatched.php) working again. Thanks again Ali Hello, My wife wants to set up a PHP Powered Demerit System at her school. I have basic PHP and MySQL skills. Basically she wants a web interface where a student logs in with Student Number and Password. Demerits and merits accrue to the students as below: Coming late to school, 1 Demerit Handing an assignment late, 2 Demerits No Demerits in 3 months equals 1 Merit assigned Student suspended after 6 / more Demerits Parent / Gaurdian emailed The student will see the table below once logged in: Student Name Student ID Date Action Demerit Merit Total A123 2012/02/26 Late Sign In 1 0 1 2012/02/28 Late Assignment 1 0 2 2012/05/29 3 month Merit earned 0 1 1 2012/06/08 Late Assignment 2 0 3 2012/06/10 Late Assignment 2 0 5 2012/06/12 Late Assignment 2 0 7 Student suspended Send email to parent/gaurdian I would really appreciate any help you can offer in terms of what PHP code to include in the HTML doc as well as how many MySQL Tables to setup as well as where to store which data? Thanks, Ishvir Hi guys,
I am needing some help of how to place the coding as I can not get it to work.
--
Basically I am building a website for the local motorclub and want some code that will "add up" each persons results.
Here is what I have come up with but it does not work;
<?php $total = mysql_fetch_array("SELECT cat1 + cat2 + cat3 + cat4 + cat5 + cat6 AS total FROM results") ?> <?php $cautotest_results = mysql_query("SELECT * FROM results WHERE cat ='1' ORDER BY cattotal DESC"); if(mysql_num_rows($cautotest_results) == '') { echo "<p>No Results Available."; } else { echo "<table width=\"800\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\" class=\"greywritinglight\" align=\"center\"> <tr align=\"center\"> <td>Competitor</td> <td>Vehicle</td> <td>Class</td> <td>Skipton</td> <td>Weston</td> <td>King Bros</td> <td>Normans</td> <td>Norwood</td> <td>Uniroyal</td> <td>Total</td> </tr>"; $x=1; while($results_row = mysql_fetch_array($cautotest_results)) { if($x%2): $rowbgcolor = "#FFFFFF"; else: $rowbgcolor = "#EEEEEE"; endif; echo "<tr align=\"center\" bgcolor=\"" .$rowbgcolor. "\">"; echo "<td>" . $results_row['competitor'] . "</td>"; echo "<td>" . $results_row['catvehicle'] . "</td>"; echo "<td>" . $results_row['catclass'] . "</td>"; echo "<td>" . $results_row['cat1'] . "</td>"; echo "<td>" . $results_row['cat2'] . "</td>"; echo "<td>" . $results_row['cat3'] . "</td>"; echo "<td>" . $results_row['cat4'] . "</td>"; echo "<td>" . $results_row['cat5'] . "</td>"; echo "<td>" . $results_row['cat6'] . "</td>"; echo "<td>" . $total . "</td>"; echo "</tr>"; $x++; } echo "</table>"; } ?>Its the top line of coding... and the echo .total. at the bottom. If you could please correct me I would be ever so grateful. If you need more info please just ask. All help is appreciated. JTM. Edited by JTM, 17 August 2014 - 12:45 AM. So I put this in the wrong place so ill try again, I need to write a code to add the price of five items with a subtotal, with tax, and then a grand total. What is the best way to do this? Every way I have tried isnt working PLEASEEEEEE HELP!!! Using crimson editor Hai everbody; I am finishing my site to open for public but before i have a small problem! Actually I am using SMF forum software! I need this help very urgently ! Just need to add login (logout) & register in the template menu!! Please guys try to help me out !! I will join the index_template.php file for you to make the correction ! (sorry for my bad english) Thank You a LOT in advance Daya this doesn't work. Please help fix this. $result1=mysql_query("SELECT * FROM applicants WHERE username = '$user' AND status = 'PendingXCD'"); if(mysql_num_rows($result1)) { $login = "&err=In progress."; echo($login); } else { $result=mysql_query("SELECT * FROM comp WHERE username = '$user' AND password ='$pass'"); if(mysql_num_rows ($result) == 0) { $login = "&err=Please retry."; echo($login); } else { $row = mysql_fetch_array($result); $user=$row['user']; $pass=$row['pass']; $login = "$user=" . $user . "$pass=" . $pass . "&err=Successful."; echo($login); } ?> <?php require_once('Connections/check_mag.php'); ?> what goes wrong with that code and when i push a link for another post in my page nothing changes? where is the wrong plzzzzz help i cant understand im looking for this for 5 days and i cant find the mistake pllzzzzzzzz heellp . if you write your cooment please give me details because i cant understand very well everything thanx for everythin:) <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } mysql_select_db($database_check_mag, $check_mag); $query_getArchives = "SELECT DISTINCT DATE_FORMAT(news.updated, '%M %Y') AS archive, DATE_FORMAT(news.updated, '%Y-%m') AS link FROM news ORDER BY news.updated DESC "; $getArchives = mysql_query($query_getArchives, $check_mag) or die(mysql_error()); $row_getArchives = mysql_fetch_assoc($getArchives); $totalRows_getArchives = mysql_num_rows($getArchives); mysql_select_db($database_check_mag, $check_mag); $query_getRecent = "SELECT news.post_id, news.title FROM news ORDER BY news.updated DESC LIMIT 10 "; $getRecent = mysql_query($query_getRecent, $check_mag) or die(mysql_error()); $row_getRecent = mysql_fetch_assoc($getRecent); $totalRows_getRecent = mysql_num_rows($getRecent); mysql_select_db($database_check_mag, $check_mag); $query_getDisplay = "SELECT news.title, news.blog_entry, DATE_FORMAT(news.updated, '%M %e, %Y') AS formatted FROM news ORDER BY news.updated DESC LIMIT 2 "; $getDisplay = mysql_query($query_getDisplay, $check_mag) or die(mysql_error()); $row_getDisplay = mysql_fetch_assoc($getDisplay); $totalRows_getDisplay = mysql_num_rows($getDisplay); $var1_getdisplay2 = "-1"; if (isset($_GET['archive'])) { $var1_getdisplay2 = $_GET['archive']; $query_getdisplay = sprintf("SELECT news.title, news.blog_entry, DATE_FORMAT(news.updated, '%%M %%e, %%Y') AS formatted FROM news WHERE DATE_FORMAT(news.updated, '%%Y-%%m') = %s ORDER BY news.updated DESC ", GetSQLValueString($var1_getdisplay2, "text")); }elseif (isset($_GET['post_id'])) { $var2_getdisplay3 = $_GET['post_id']; $query_getdisplay= sprintf("SELECT news.title, news.blog_entry, DATE_FORMAT(news.updated, '%%M %%e, %%Y') AS formatted FROM news WHERE news.post_id = %s ", GetSQLValueString($var2_getdisplay3, "int")); }else{ $query_getDisplay = "SELECT news.title, news.blog_entry, DATE_FORMAT(news.updated, '%M %e, %Y') AS formatted FROM news ORDER BY news.updated DESC LIMIT 2 ";} $getDisplay = mysql_query($query_getDisplay, $check_mag) or die(mysql_error()); $row_getDisplay = mysql_fetch_assoc($getDisplay); $totalRows_getDisplay = mysql_num_rows($getDisplay); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/totemp.dwt.php" codeOutsideHTMLIsLocked="false" --> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="robots" content="index, follow" /> <meta name="keywords" content="Σύλλογος Ηπειρωτών Πιερίας,Χορευτικός Σύλλογος,Χορός,Χορευτής,Ήπειρος,SYLLOGOS HPIROTON PIERIAS,pieria,ΠΙΕΡΙΑ" /> <meta name="description" content="Σύλλογος Ηπειρωτών Πιερίας,Χορευτικός Σύλλογος,Χορός,Χορευτής,Ήπειρος,SYLLOGOS HPIROTON PIERIAS,pieria,ΠΙΕΡΙΑ" /> <!-- InstanceBeginEditable name="doctitle" --> <title>Check Magazine</title> <!-- InstanceEndEditable --> <link href="styles/check_cs5.css" rel="stylesheet" type="text/css" /> <link href="styles/check_menu.css" rel="stylesheet" type="text/css" /> <!-- InstanceBeginEditable name="head" --> <!-- InstanceEndEditable --> </head> <body> <!-- DO NOT MOVE! The following AllWebMenus linking code section must always be placed right AFTER the BODY tag--> <!-- ******** BEGIN ALLWEBMENUS CODE FOR menu ******** --> <script type="text/javascript">var MenuLinkedBy="AllWebMenus [4]",awmMenuName="menu",awmBN="798";awmAltUrl="";</script><script charset="UTF-8" src="menu.js" type="text/javascript"></script><script type="text/javascript">awmBuildMenu();</script> <!-- ******** END ALLWEBMENUS CODE FOR menu ******** --> <div id="container"> <h1>Check Magazine: Fashion and Lifestyle</h1> <div id="eikona"><img src="images/silogos.jpg" width="1211" height="134" alt="silogos" /></div> <div id="bara"> <p> </p> </div> <!-- InstanceBeginEditable name="EditRegion3" --> <div id="blog"> <p> </p> <div id="archive"> <h3>Archives</h3> <ul><?php do{?> <li><a href="news1.php"> <a href="news1.php"><?php echo $row_getArchives['archive'];?></a><a></li> <?php } while ($row_getArchives=mysql_fetch_assoc($getArchives));?> </ul> </div> <div id="recent"> <h3>RECENT</h3> <ul> <?php do { ?> <li><a href="news1.php?post_id=<?php echo $row_getRecent['post_id']; ?>"><?php echo $row_getRecent['title']; ?></a></li> <?php } while ($row_getRecent = mysql_fetch_assoc($getRecent)); ?> </ul> </div> <div id="blog_posts"> <?php do { ?> <h2><?php echo $row_getDisplay['title']; ?></h2> <p>Uploaded on <?php echo $row_getDisplay['formatted']; ?></p> <p><?php echo nl2br($row_getDisplay['blog_entry']); ?></p> <?php } while ($row_getDisplay = mysql_fetch_assoc($getDisplay)); ?> </div> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> </div> <!-- InstanceEndEditable --> <p> </p> </div> </body> <!-- InstanceEnd --></html> <?php mysql_free_result($getArchives); mysql_free_result($getRecent); mysql_free_result($getDisplay); ?> I have a small mp3 script and its running accurately ...i want to check the mp3 URL before playing it whether the mp3 link active or broken ....how to check the link is active or broken in php thanks Could some one please guide me to a possible script to accomplish this task.... I want to pull and display two separate things that are in two separate places and display them as one link on a page. I have figured out how to display the data to a page and also how to display the files to a page separately but need to accomplish this and join the 3 things together. I have a library table in the database that stores the product_code and product_name example: pk-pen(product_code) traditional fountain pen(product_name) ---- (this is where I need to get the data from) Then I have a folder on the server that is called library that has the pdf files in it. Each pdf file has the same name as the product_code that is in the database. example: pk-pen_ins.pdf What I need to accomplish is grabbing the product_code and product_name for the database and then go to the folder on the server and add the correct pdf file with that data and display it as a link on a page for customers to download. bee struggling with this and pasted code that i have to do each task separately but cant seem to get it all in one script to do the above. I understand that this could be asking for a lot here but I am new to this and would be forever in debt to your kindness. Thanks on this in advance I'm trying to update a field in my MySQL but instead of updating this makes the field BLANK. my code: $SomeVar = $_POST['finco']; mysql_query("UPDATE c_applicants SET streetz='$cts' WHERE username = '".$SomeVar."'"); $result = mysql_query($query); Hi I am beginning the first stages of a tumble log and am having some trouble, this works. <?php $connection = @mysql_connect('localhost','admin','asdf'); if(!$connection) ( die('Could not connect to the server!' .mysql_error()) ) ?> but if I add the following I get an error: <?php $connection = @mysql_connect('localhost','admin','asdf'); if(!$connection) ( die('Could not connect to the server!' .mysql_error()) ) if(!mysql_select_db('tumblelog')) ( die('Could not connect to database') ) ?> This is the error: Quote Parse error: syntax error, unexpected T_IF in E:\AppServ\www\tumblelog\database.php on line 10 I also tried this to solve the problem: <?php $connection = @mysql_connect('localhost','admin','glock123'); if(!$connection) ( die('Could not connect to the server!' .mysql_error()) ) $db = mysql_select_db('tumblelog')) if(!$db) ( die('nope') ) ?> that only gives me this error: Quote Parse error: syntax error, unexpected T_VARIABLE in E:\AppServ\www\tumblelog\database.php on line 9 Hello guys it's me again. I have not posted a question in awhile so I am glad to be on PHPFreaks again. Anyways here is my question, I have simple "Filter By" or "Refine By" script I am developing. It's foundation is primarily database (MySQL) and does not use XML or other table files. This script simply add's filtered array ("objects") to the url as the customer filters his/her search. An example, $attributeCodes("processor_type","color","memory"); // These arrays are defined and built from the database on the time of the request. So they are automatically updated. The above array is used in an if/and/or statement to look for these attribute codes. If it finds it and it has a value it then refines the MySQL query to look for products with the said attribute code. Now that we have the basics out there of how it works I am at the part where it confuses me. I give the user the ability to filter his/her search, however I want the user to be able to remove these filters separately if wanted. So for example the customer filters, Domain.com/search/productsearch.php?catId=112&processor_type=AMD&memory=2gb The customer does not need the memory filter and wishes to remove that specific item or vice-verse he/she does not want to search by processor_type. How is it that I can remove specifically one attribute and its value from the URL? So the url will then look like, Domain.com/search/productsearch.php?catID=112&processor_type=AMD or Domain.com/search/productsearch.php?catID=112&memory=2gb Any help would be great. Or if you have any suggestions on a different method to filter by attributes products. Suggestions and criticism are welcome. Please do not be shy or modest when it comes to giving me advice as I am trying to learn efficiently. - Travis Hey, I would there be a way i could create a form in which upon entering a domain name/URL it will tell you how many connections there are to the site and how many (if any) MySQL queries are running? If I add this line to a wordpress footer it displays the number of sql queries. Code: [Select] <?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?> seconds. Any help is greatly appreciated. Thanks. Hi I need some help. I have a page which will show all the result based on the user sign in. And it will show something like this ID | Event Start Date | Event End Date | Event Details 1 19-11-2011 20-11-2011 View Event Details The view event details is a link so when I click on the link, it will link me to the next page (eventDetails.php?id=1) And at eventDetails.php?id=1 page, it would requires user to input whether they will be attending or not and will they be bringing their friend along then submit the form. When I submit, how do I pass all the data from eventDetails.php?id=1 page to confirmation.php page (after submitting)? You might want to refer to the attached coding. All the 2 php pages are working fine but when submit to confirmation.php page, the data are not post over so I didn't attach the confirmation.php page. Thanks Ben Chew [attachment deleted by admin] I have a sql statement w/c suppose to output only those records w/c has a name of seller. But, it keeps showing all the records. Code: [Select] <?php session_start(); if(isset($_SESSION['name']) || ($_SESSION['contact']) || ($_SESSION['address']) ) { ini_set('display_errors', 0); $name = $_SESSION['name']; $contact = $_SESSION['contact']; $address = $_SESSION['address']; ?> <div id="apDiv1"> <?php echo "Name : $name"; echo "</br>"; echo "Name : $contact"; echo "</br>"; echo "Name : $address"; ?> <div id="apDiv2"> <?php $host="localhost"; $username="root"; $password=""; $db_name="feedbackdb"; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM Feedbacks WHERE Seller = $name"; $result=mysql_query($sql); echo "<table border=\"5\" width=\"600\" >"; echo "<tr><th>Feedbacks</th><th>From</th><th> To </th>"; if(mysql_num_rows($result)) { while($row = mysql_fetch_assoc($result)) { echo "<tr><td>"; echo "" .$row['Feedback']."<br></td>"; echo "<td>".$row['From']."<br></td>"; echo "<td>".$row['Seller']."<br></td>"; echo "</tr>"; } } else { echo "<tr><td align=\"center\"> No Feedback</td></tr>"; } ?></div> </div> <?php } else { header("location:loginpage.php");; } ?> How can I get it so the following work: echo utf8_decode($xml->healings[0]->$xmla[0]->descrip[0]); // NOT work echo utf8_decode($xmlb); // NOT work <?php $xml = simplexml_load_file('extra.xml'); $xmla = "test"; $xmlb = "$xml->healings[0]->".$xmla."[0]->descrip[0]"; echo utf8_decode($xml->healings[0]->test[0]->descrip[0]); // works echo utf8_decode($xml->healings[0]->$xmla[0]->descrip[0]); // NOT work echo utf8_decode($xmlb); // NOT work ?> Im having trouble making a code for a feedback system. Can anyone help me to make a code like this. I have a table w/c contains -------------------------------------------- | Itemname | Itemprice | Seller | Laptop | 15000 | Name Phone | 5000 | Name ----------------------------------- Then.. i want a code that will query those values.. And have a button : [BUY] and [POST FEEDBACK] after the values. Then after clicking POST FEEDBACK it will show the values of the SELLER name in another page. HELP ME PLS |