Home > front end >  PHP beginners have a problem for answers
PHP beginners have a problem for answers

Time:09-16


The code is as follows:


<meta charset="utf-8" & gt;
Modify the commodity information & lt;/title> <br/></head> <br/><body style="margin: 0 px 0 px 0 px 0 px;"> <br/><? <br/>If ($_REQUEST [" P_ID "]!="") <br/>{<br/>$pid=$_REQUEST [" P_ID "]; <br/>$conn=mysqli_connect (" localhost ", "root", "");//1 link to the database server <br/>$select=mysqli_select_db (" 88 kengdao_db ", $conn);//2, select the database <br/>$STR="select * from Product_Info where P_ID=". $pid; <br/>$arr=mysqli_query ($conn, "$STR");//delete statements <br/>$result=mysqli_fetch_array ($arr); <br/>?> <br/><The form action="product_update_do. PHP" method="post" enctype="multipart/form - data" & gt; <br/><The table border="1" width="100%" & gt; <br/><tr> <br/><Td colspan="2" align="center" & gt; <br/>Modify the commodity information <br/></td> <br/></tr> <br/><tr> <br/><td> <Font color="red" & gt; * & lt;/font> Name of commodity: & lt;/td> <br/><td> <Input type="text" name="txt_name" value="https://bbs.csdn.net/topics/<? Echo $result [] "P_Name"? & gt;"/> </td> <br/></tr> <br/><tr> <br/><td> <Font color="red" & gt; * & lt;/font> Commodity images: & lt;/td> <br/><td> <Input type="file" name="txt_image"/& gt; <br/></tD> <br/></tr> <br/><tr> <br/><td> <Font color="red" & gt; * & lt;/font> Price: & lt;/td> <br/><td> <Input type="text" name="txt_price" value="https://bbs.csdn.net/topics/<? Echo $result [] "P_Price"? & gt;"/> <br/></tD> <br/></tr> <br/><tr> <br/><td> Summary: <br/></td> <br/><td> <br/><Textarea name="txt_intro" rows="8" cols="30" & gt; <? Echo $result [] "P_Intro"?> </textarea> <br/><Input type="image" name="img1" SRC="https://bbs.csdn.net/topics/<? Echo $result [] "P_Image"?> "Width=" 130 "height=" 130 "/& gt; <br/></td> <br/></tr> <br/><br/><tr> <br/><Td colspan="2" align="center" & gt; <br/><Input type="hidden" name="txt_id" value="https://bbs.csdn.net/topics/<? Echo $result [] "P_ID"? & gt;"/> <br/><Input type="hidden" name="txt_image2" value="https://bbs.csdn.net/topics/<? Echo $result [] "P_Image"? & gt;"/> <br/><Input type="submit" value="https://bbs.csdn.net/topics/"/& gt; <br/></td> <br/></tr> <br/></table> <br/></form> <br/><? <br/>} <br/>?> <br/></body> <br/></html><p class="article - content rp"> CodePudding user response: </p>Read this article: https://www.php.cn/php-weizijiaocheng-392940.html <br/><br/>At the beginning of & lt; ? The use of PHP include you<p class="article - content rp"> CodePudding user response: </p>Ok, I will go and see<p class="article - content rp"> CodePudding user response: </p>Now is mainly database data cannot be displayed in the web page, the problem how to solve the code SRC="https://bbs.csdn.net/topics/<? Echo $result [] "P_Image"?> 'didn't work, it directly display on a web page,<p class="article - content rp"> CodePudding user response: </p><? PHP echo $XXX; ?><p class="article - content rp"> CodePudding user response: </p>Or not <br/><img SRC="https://img.codepudding.com/202009/75835161159002.png" Alt=""/> <br/><! Doctype html> <br/><HTML lang="useful" & gt; <br/><head> <br/><meta charset="utf-8" & gt; <br/><title> Modify the commodity information & lt;/title> <br/></head> <br/><body style="margin: 0 px 0 px 0 px 0 px;"> <br/><? <br/>$RST=$_REQUEST [" P_ID "]; <br/>If ($RST!="") <br/>{<br/>$pid=$RST; <br/>$conn=mysqli_connect (" localhost ", "root", "");//1 link to the database server <br/>$select=mysqli_select_db (" 88 kengdao_db ", $conn);//2, select the database <br/>$STR="select * from Product_Info where P_ID=". $pid; <br/>$arr=mysqli_query ($conn, "$STR");//delete statements <br/>$result=mysqli_fetch_array ($arr); <br/>?> <br/><The form action="product_update_do. PHP" method="post" enctype="multipart/form - data" & gt; <br/><The table border="1" width="100%" & gt; <br/><tr> <br/><Td colspan="2" align="center" & gt; <br/>Modify the commodity information <br/></td> <br/></tr> <br/><tr> <br/><Td color="red" & gt; * name of commodity: & lt;/td> <br/><td> <Input type="text" name="txt_name" value="https://bbs.csdn.net/topics/<? Echo $result [' P_Name]; ? & gt;"/> </td> <br/></tr> <br/><tr> <br/><Td color="red" & gt; * goods images: & lt;/td> <br/><td> <Input type="file" name="txt_image"/& gt; <br/></td> <br/></tr> <br/><tr> <br/><Td color="red" & gt; * price: & lt;/td> <br/><td> <Input type="text" name="txt_price" value="https://bbs.csdn.net/topics/<? Echo $result [' P_Price]; ? & gt;"/> <br/></td> <br/></tr> <br/><tr> <br/><td> Summary: <br/></td> <br/><td> <br/><Textarea name="txt_intro" rows="8" cols="30" & gt; <? Echo $result [' P_Intro]; ?> </textarea> <br/><Input type="image" name="img1" SRC="https://bbs.csdn.net/topics/<? Echo $result [' P_Image]; ? & gt;" Width="130" height="130"/& gt; <br/></td> <br/></tr> <br/><br/><tr> <br/><Td colspan="2" align="center" & gt; <br/><Input type="hidden" name="txt_id" value="https://bbs.csdn.net/topics/<? Echo $result [' P_ID]; ? & gt;"/> nullnullnullnullnullnullnullnullnullnullnullnull </div> <div class="th_page th_page_color"></div> <div class="umCopyright"> <p>Page link:<a href="/frontend/3273.html" target="_blank" style="color:#999">https//www.codepudding.com/frontend/3273.html</a></p> </div> <div class="detail-arr"> <div class="detail-arr-left">Prev:<a href='/frontend/3272.html'>Web applications to provide an interface file download, how to return the file deleted this kind of</a></div> <div class="detail-arr-right">Next:<a href='/frontend/3274.html'>ID value of emergency</a></div> </div> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="hot-tags neitags"> <ul> <li><i class="iconfont icon-x-tags"></i> Tags:  </li> <a href='/e/tags/?tagname=HTML+%28CSS%29' target='_blank'>HTML (CSS)</a> </ul> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="xiangguan"> <ul class="msg msghead"> <li class="tbname">Related</li> </ul> <ul> </ul> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="flinks"> <ul> <li><i class="iconfont icon-x-tags"></i> Links:  </li> <li class="liflinks"><a target="_blank" href="/" title="CodePudding">CodePudding</a></li> </ul> </div> </div> </div> </div> <div class="footer"> <p><span style="font-size:16px;color:#666;font-weight: bold">About Us:</span>  <a href="https://www.codepudding.com/contact.html">Contact Us</a>      <a href="https://www.codepudding.com/service.html">Terms of Service</a>      <a href="https://www.codepudding.com/privacy.html"> Privacy Policy</a></p> <p class="foot_info">Copyright © 2010-2023,Powered By <a href="/" target="_blank">CodePudding</a> </p> </div> <script type="text/javascript" src="/skin/code/tianhu.js"></script> </body></html>