PHP - Php Unit Testing '$_server['http_host']' Problem While Hitting Via Command Promt
pls help me..
i am new to PHP unit testing concept. i just wrote a PHP unit test case for a login module in ZEND frame work. for that we have to see the result via command promt. but in some places of zend frame work we are using '$_SERVER['HTTP_HOST']' to get server host name but it can get only by hitting via browser so while am hitting via command promt it will give error message lik this(given below) Generating code coverage report, this may take a moment.PHP Notice: Undefined index: HTTP_HOST in /opt/coolstack/apache2/htdocs/LPS/application/bootstrap/Bootstrap.php on line 147 Notice: Undefined index: HTTP_HOST in /opt/coolstack/apache2/htdocs/LPS/application/bootstrap/Bootstrap.php on line 147 PHP Notice: Undefined index: HTTP_HOST in /opt/coolstack/apache2/htdocs/LPS/application/bootstrap/Bootstrap.php on line 197 Notice: Undefined index: HTTP_HOST in /opt/coolstack/apache2/htdocs/LPS/application/bootstrap/Bootstrap.php on line 197 PHP Notice: Undefined index: HTTP_HOST in /opt/coolstack/apache2/htdocs/LPS/library/Zaah/Controller/Plugin/Ssl.php on line 79 Notice: Undefined index: HTTP_HOST in /opt/coolstack/apache2/htdocs/LPS/library/Zaah/Controller/Plugin/Ssl.php on line 79 i cant give server host name at all the places. so please help me how to solve this problem.... thanks Yogesh Similar TutorialsWhat is different between: $host = $_SERVER['HTTP_HOST']; and $host = "www.my-domain.com"; Somehow when I have to use first line then $_SESSION vars doesn't go through two different domains. Just wanted some general advice/guidance, I know there are plenty of articles and tutorials online about unit testing, but I just wanted to get a first hand perspective off of some of you guys... What are some real world examples of actual PHP Unit Testing? Also any unit testing frameworks you can recommend? Apologies if this has been covered before. Hi, I have a class XMLtool where one of the functions is to output a parameter-passed dom document and then output to the browser screen, so basically: function outputXML($domDocument) { if has attributes print cur nodes attributes for each child, if child is element node outputXML(cur node) else if child is text print text end for each } Please I am not sure what type of unit tests I can perform. I'd appreciate all the help! I’ve got a colleague who was brought in as a testing specialist to help improve code quality and reduce bugs. I’ve done a little testing before, but am no means an expert. When they joined I was really excited to learn from them as testing is definitely an area I lack experience. He’s got good coverage and he writes tests for literally everything he does, but it’s something like 95% mocks as opposed to what I would call “black box” testing; testing the input and output. Does that sound reasonable? As I say, I’m not an expert, but his testing strategy doesn’t seem particularly effective and it puts constraints over exactly how code is implemented rather than testing that things behave correctly. I must confess, I've not really done much unit testing at all in the last 3 years. Can anyone give me an idea of what they would test and why that would be faster or more efficient than running the code as a user? One area I can see it having huge benefits is when I'm testing methods which interact with a database, like user registration, which I would probably test by registering several times - fixing any bugs, making amendments and repeating. Ok, so I kinda sold the idea to myself there But, what about for small applications? I've seen people testing whether a variable is countable...why would I not just check the output immediately? Appreciate any advice. hello dear php-experts how to testrun a drive with command-line? note: i had several blank screens during the last week does this somewhat have to do with the hard-drive? which tests can be done? what's the difference between them? how to use them. i print_r($_SERVER). there are no result of $_SERVER['PATH_INFO'] and $_SERVER['PORIG_PATH_INFO'] .why? how to enable it.i have read the php manual about them, but still don't understand . expect someone can explain them.thank you Hi there, I am having some issues with a page failing security tests because of a form. The form's text input files is getting sanitized when posted but the only thing I can think is that the form action="" is $_SERVER['REQUEST_URI'] and this then includes anything that is within the URL. <form name="zipcode" id="zipcode" action="<?php echo htmlentities($_SERVER['REQUEST_URI'], ENT_QUOTES, "UTF-8"); ?>" method="post"> <label for="zip" class="smalllbl">Zipcode: </label> <input type="text" class="smallzip" name="zip" id="zip" value="" /> </form> Has anyone else experienced this when running PCI Compliance style security tests? And if you have, why would this happen as the same form action is used elsewhere with no issues. Many thanks in advance Simon With only FireFox, I am getting some strange extra hit to my server soon after the first one. It seems simlar to when the browser is looking for favicon.ico, but I have an empty file in my public root. For troubleshooting, I added the following to my script, and have posted the results. The culprit appears to be: [HTTP_ACCEPT] => image/png,image/*;q=0.8,*/*;q=0.5
What could be causing this? Even if you don't have an exact answer, any suggestions on what to look for would be appreciated.
$old_server=isset($_SESSION['server'])?$_SESSION['server']:$_SERVER; $difference = array_diff_assoc($_SERVER, $old_server); $difference2 = array_diff_assoc($old_server,$_SERVER); $_SESSION['server']=$_SERVER; echo('$_SERVER<pre>'.print_r($_SERVER,1).'</pre>'); echo('$old_server<pre>'.print_r($old_server,1).'</pre>'); echo('$difference<pre>'.print_r($difference,1).'</pre>'); echo('$difference2<pre>'.print_r($difference2,1).'</pre>'); syslog(LOG_INFO,print_r($difference,1)); $_SERVER Array ( [REDIRECT_HTTPS] => on [REDIRECT_SSL_TLS_SNI] => test.sites.example.com [REDIRECT_STATUS] => 200 [HTTPS] => on [SSL_TLS_SNI] => test.sites.example.com [HTTP_HOST] => test.sites.example.com [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0 [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 [HTTP_ACCEPT_LANGUAGE] => en-US,en;q=0.5 [HTTP_ACCEPT_ENCODING] => gzip, deflate [HTTP_REFERER] => https://test.sites.example.com/administrator/index.php?cid=2&controller=sell&id=643341356 [HTTP_COOKIE] => BACKSESSID=5il7gj9p1f3etu37l8vk8tvur1 [HTTP_CONNECTION] => keep-alive [HTTP_CACHE_CONTROL] => max-age=0 [PATH] => /sbin:/usr/sbin:/bin:/usr/bin [SERVER_SIGNATURE] => Apache/2.2.15 (CentOS) Server at test.sites.example.com Port 443 [SERVER_SOFTWARE] => Apache/2.2.15 (CentOS) [SERVER_NAME] => test.sites.example.com [SERVER_ADDR] => 192.168.1.200 [SERVER_PORT] => 443 [REMOTE_ADDR] => 192.168.1.1 [DOCUMENT_ROOT] => /var/www/example/html_sites [SERVER_ADMIN] => root@localhost [SCRIPT_FILENAME] => /var/www/example/html_sites/index.php [REMOTE_PORT] => 63989 [REDIRECT_QUERY_STRING] => admin=administrator/index.php&cid=2&controller=sell&id=643341356 [REDIRECT_URL] => /administrator/index.php [GATEWAY_INTERFACE] => CGI/1.1 [SERVER_PROTOCOL] => HTTP/1.1 [REQUEST_METHOD] => GET [QUERY_STRING] => admin=administrator/index.php&cid=2&controller=sell&id=643341356 [REQUEST_URI] => /administrator/index.php?cid=2&controller=sell&id=643341356 [SCRIPT_NAME] => /index.php [PHP_SELF] => /index.php [REQUEST_TIME_FLOAT] => 1422985053.698 [REQUEST_TIME] => 1422985053 ) $old_server Array ( [REDIRECT_HTTPS] => on [REDIRECT_SSL_TLS_SNI] => test.sites.example.com [REDIRECT_STATUS] => 200 [HTTPS] => on [SSL_TLS_SNI] => test.sites.example.com [HTTP_HOST] => test.sites.example.com [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0 [HTTP_ACCEPT] => image/png,image/*;q=0.8,*/*;q=0.5 [HTTP_ACCEPT_LANGUAGE] => en-US,en;q=0.5 [HTTP_ACCEPT_ENCODING] => gzip, deflate [HTTP_REFERER] => https://test.sites.example.com/administrator/index.php?cid=2&controller=sell&id=643341356 [HTTP_COOKIE] => BACKSESSID=5il7gj9p1f3etu37l8vk8tvur1 [HTTP_CONNECTION] => keep-alive [PATH] => /sbin:/usr/sbin:/bin:/usr/bin [SERVER_SIGNATURE] => Apache/2.2.15 (CentOS) Server at test.sites.example.com Port 443 [SERVER_SOFTWARE] => Apache/2.2.15 (CentOS) [SERVER_NAME] => test.sites.example.com [SERVER_ADDR] => 192.168.1.200 [SERVER_PORT] => 443 [REMOTE_ADDR] => 192.168.1.1 [DOCUMENT_ROOT] => /var/www/example/html_sites [SERVER_ADMIN] => root@localhost [SCRIPT_FILENAME] => /var/www/example/html_sites/index.php [REMOTE_PORT] => 63970 [REDIRECT_QUERY_STRING] => admin=administrator/ [REDIRECT_URL] => /administrator/ [GATEWAY_INTERFACE] => CGI/1.1 [SERVER_PROTOCOL] => HTTP/1.1 [REQUEST_METHOD] => GET [QUERY_STRING] => admin=administrator/ [REQUEST_URI] => /administrator/ [SCRIPT_NAME] => /index.php [PHP_SELF] => /index.php [REQUEST_TIME_FLOAT] => 1422985038.5 [REQUEST_TIME] => 1422985038 ) $difference Array ( [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 [HTTP_CACHE_CONTROL] => max-age=0 [REMOTE_PORT] => 63989 [REDIRECT_QUERY_STRING] => admin=administrator/index.php&cid=2&controller=sell&id=643341356 [REDIRECT_URL] => /administrator/index.php [QUERY_STRING] => admin=administrator/index.php&cid=2&controller=sell&id=643341356 [REQUEST_URI] => /administrator/index.php?cid=2&controller=sell&id=643341356 [REQUEST_TIME_FLOAT] => 1422985053.698 [REQUEST_TIME] => 1422985053 ) $difference2 Array ( [HTTP_ACCEPT] => image/png,image/*;q=0.8,*/*;q=0.5 [REMOTE_PORT] => 63970 [REDIRECT_QUERY_STRING] => admin=administrator/ [REDIRECT_URL] => /administrator/ [QUERY_STRING] => admin=administrator/ [REQUEST_URI] => /administrator/ [REQUEST_TIME_FLOAT] => 1422985038.5 [REQUEST_TIME] => 1422985038 ) I notice a situation where if someone goes to a webpage that uses SESSIONS to load information on the page and the user then goes to another page and then hits back on the broswer the page he went back to doesnt load any of the SESSION variable i had for the page. Anyone know how to fix this? at first i thought it had something to do with broswer cache but idk
I need to create the unique SKU (Stock Keeping Unit) name for each products mixed with i.e.: SKU for a product with
id=13, becomes : BI-IKHA0013 This is how I tried: $inm = "Bio Clean green500ml"; $cnm = "INSECTS KILLERS"; $bnm = "HARPIC "; echo SKU_gen($inm, $cnm,$bnm,20).'<br>'; function SKU_gen($pname, $cat=null, $brand=null, $id = null, $l = 2){ $results = ''; // empty string $str1 = array_shift(explode(' ',$pname)); $str1 = strtoupper(substr($str1, 0, $l)); $str2 = array_shift(explode(' ',$cat)); $str2 = strtoupper(substr($str2, 0, $l)); $str3 = array_shift(explode(' ',$brand)); $str3 = strtoupper(substr($str3, 0, $l)); $id = str_pad($id , 4, 0, STR_PAD_LEFT); $results .= "{$str1}-{$str2}{$str3}{$id}"; return $results; } But this function is not working as expected when category of brand values become NULL. Let's say there is an application where a user would like to use English and Metric systems to enter values. For example, to handle customer orders where customers give data in this or that system, (but not both).
From the user-view, all the user cares about is if they can select English or Metric system, enter their values, click submit, and have their data added to the page in their choice of system, and have their values (and choice of system) stay the same.
The back end however is set up to do "compute" operations with English system in mind only. So inside back end, before the compute module, all the values should be converted to English. Some things like precomputed constants, that exist in computations are in English unit of measurements.
So I have attached an image of what I am thinking ..
* first (top) way is one where the front-end takes care of conversions. Back-end is not aware of another system (which makes it difficult sometimes, when trying to display a page back to the user saying "We know you chose system X"), and being aware of chosen system is something that I think is beneficial.
* the second (bottom) way is where front end is merely a passing device to back end, and bac-end takes care of conversions. Back-end is also aware of the two systems
My question is -- is there a preferred way to design an application when it comes to considerations above? Have a system-aware back-end, or try to localize system to front end only?
Attached Files
ways of encoding unit system.png 207.92KB
0 downloads Is there a server variable that holds the full url including the page name.php
TIA
Paul
Hello PHPers, Need help. I am using $_SERVER['REQUEST_URI']; in order to obtain the URL that the visitor came from. No matter what I try to change I get more info than required. IE. mojo/mojo.php?width=640&height=480&doc_location=/&doc_title=Marc%20Rob&doc_refer=http%3A//www.aaa.com.au/rob.html instead and what I should be getting is just http://www.aaa.com.au/rob.html Could somebody please help me and let me know why this is appearing with the extra info which I do not want. Thank you. HJ I have a bit of code that's supposed to verify the referring page. If it's processlogin.php, then it allows access. Otherwise, it fails. This works: Code: [Select] <?php $ref = $_SERVER['PHP_SELF']; if ($ref != '/processlogin.php') header('Location: sorry1.php'); ?> However, when I try and show more data on the page, it fails on Reload. At first I thought it was because the page is seeing itself as an invalid Referrer. So, I added the page itself as a valid referrer, as seen below. Code: [Select] <?php $ref = $_SERVER['PHP_SELF']; if (($ref != '/processlogin.php') || ($ref != '/atv_list.php')) header('Location: sorry1.php'); ?> The problem is that now NOTHING works the way I think it should. Whereas if ($ref != '/processlogin.php') worked just fine when it was by itself, now it throws the Fail state. However, the page can now be reloaded, which doesn't make much sense to me. Next I attempted the following: Code: [Select] <?php $ref = $_SERVER['PHP_SELF']; if ($ref != '/processlogin.php' || $ref != '/atv_list.php') header('Location: sorry1.php'); ?> Which didn't work either. So I thought that MAYBE it's reprocessing through processlogin.php, and the Variables in the URL were causing the problem. So, I tried this: <?php $ref = $_SERVER['PHP_SELF']; if (strstr($ref,'/processlogin.php')) {header('Location: sorry1.php'); } ?> And again it doesn't work. Anyone know where I went so horribly, horribly wrong? I have been recording IP address's on a website since June 2006. This has worked for years up until 9th Dec 2014 when my database has stopped reporting the IP address and all I get since is 127.0.0.1
What has happened? I don't own the server it is being hosted by stramline.net
HELP
Using $_SERVER['REQUEST_TIME'] How could I make it so it just echo's HOUR:MINUTE:SECOND ?? www.php.net doesn't give enough information for that. At the very bottom of the page i am using the tag <? $_SERVER['REMOTE_ADDR'] ?> to show the clients ip address but it is not working any ideas where i am going wrong? Code: [Select] <?php require("../include/validate_mem_cookie.php"); ?> <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Edit Your Pictures</title> </head> <link rel="stylesheet" type="text/css" href="../graphic_include/newstudio.css"> <body> <?php $uincookie = $_COOKIE["uin"]; require("../include/mysqldb.php"); $con = mysql_connect("$dbhost","$dbuser","$dbpass"); $imgff = "/p1c5_u91o4d/" ; if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("$dbame", $con); $result = mysql_query("SELECT * FROM Reg_Profile_images WHERE uin ='$uincookie'"); $i=1; while($rows = mysql_fetch_array($result)){ $image_zero = $rows[image_zero] ; $image_one = $rows[image_one] ; $image_two = $rows[image_two] ; $image_three = $rows[image_three] ; $image_four = $rows[image_four] ; $image_five = $rows[image_five] ; $image_six = $rows[image_six] ; $image_seven = $rows[image_seven] ; $image_eight = $rows[image_eight] ; $image_nine = $rows[image_nine] ; $image_ten = $rows[image_ten] ; $image_eleven = $rows[image_eleven] ; if (!empty($rows[image_zero])) { print "<p> </p> <table width=\"0\" border=\"0\"> <tr> <td><table width=\"112\" height=\"129\" border=\"0\"> <tr> <td><img src=\"$imgff$image_zero\" alt=\"\" width=\"156\" height=\"166\" /></td> </tr> <tr> <td><form id=\"form3\" name=\"form1\" method=\"post\" action=\"..\p1c5_u91o4d\delete_image.php\"> <label> <div align=\"left\"> <input type=\"submit\" name=\"button3\" id=\"button3\" value=\"Delete Picture\" /> <input type=\"hidden\" name=\"img[]\" value=\"$image_one\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_two\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_three\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_four\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_five\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_six\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_seven\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eight\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_nine\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_ten\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eleven\"> <input type=\"hidden\" name=\"remove\" value=\"$image_zero\"> <input type=\"hidden\" name=\"updel\" value=\"image_zero\"> </div> </label> </form></td> </tr> <tr> <td><form id=\"form4\" name=\"form2\" method=\"post\" action=\"change_order.php\"> <label> <div align=\"left\"> <input type=\"submit\" name=\"button3\" disabled=\"disabled\" id=\"button4\" value=\"PRIMARY PICTURE\" /> <input type=\"hidden\" name=\"img[]\" value=\"$image_zero\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_one\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_two\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_three\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_four\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_five\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_six\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_seven\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eight\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_nine\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_ten\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eleven\"> </div> </label> </form></td> </tr> </table></td>\n"; } if (!empty($rows[image_one])) { print "<td><table width=\"112\" height=\"129\" border=\"0\"> <tr> <td><img src=\"$imgff$image_one\" alt=\"\" width=\"156\" height=\"166\" /></td> </tr> <tr> <td><form id=\"form5\" name=\"form1\" method=\"post\" action=\"..\p1c5_u91o4d\delete_image.php\"> <label> <div align=\"left\"> <input type=\"submit\" name=\"button4\" id=\"button5\" value=\"Delete Picture\" /> <input type=\"hidden\" name=\"img[]\" value=\"$image_zero\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_two\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_three\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_four\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_five\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_six\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_seven\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eight\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_nine\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_ten\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eleven\"> <input type=\"hidden\" name=\"remove\" value=\"$image_one\"> <input type=\"hidden\" name=\"updel\" value=\"image_one\"> </div> </label> </form></td> </tr> <tr> <td><form id=\"form6\" name=\"form2\" method=\"post\" action=\"change_order.php\"> <label> <div align=\"left\"> <input type=\"submit\" name=\"button4\" id=\"button6\" value=\"Make Primary\" /> <input type=\"hidden\" name=\"img[]\" value=\"$image_one\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_zero\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_two\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_three\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_four\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_five\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_six\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_seven\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eight\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_nine\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_ten\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eleven\"> </div> </label> </form></td> </tr> </table></td>\n"; } if (!empty($rows[image_two])) { print "<td><table width=\"112\" height=\"129\" border=\"0\"> <tr> <td><img src=\"$imgff$image_two\" alt=\"\" width=\"156\" height=\"166\" /></td> </tr> <tr> <td><form id=\"form7\" name=\"form1\" method=\"post\" action=\"..\p1c5_u91o4d\delete_image.php\"> <label> <div align=\"left\"> <input type=\"submit\" name=\"button5\" id=\"button7\" value=\"Delete Picture\" /> <input type=\"hidden\" name=\"img[]\" value=\"$image_zero\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_one\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_three\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_four\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_five\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_six\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_seven\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eight\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_nine\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_ten\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eleven\"> <input type=\"hidden\" name=\"remove\" value=\"$image_two\"> <input type=\"hidden\" name=\"updel\" value=\"image_two\"> </div> </label> </form></td> </tr> <tr> <td><form id=\"form8\" name=\"form2\" method=\"post\" action=\"change_order.php\"> <label> <div align=\"left\"> <input type=\"submit\" name=\"button5\" id=\"button8\" value=\"Make Primary\" /> <input type=\"hidden\" name=\"img[]\" value=\"$image_two\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_zero\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_one\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_three\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_four\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_five\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_six\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_seven\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eight\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_nine\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_ten\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eleven\"> </div> </label> </form></td> </tr> </table>\n"; } if (!empty($rows[image_three])) { print " </td> <td><table width=\"112\" height=\"129\" border=\"0\"> <tr> <td><img src=\"$imgff$image_three\" alt=\"\" width=\"156\" height=\"166\" /></td> </tr> <tr> <td><form id=\"form9\" name=\"form1\" method=\"post\" action=\"..\p1c5_u91o4d\delete_image.php\"> <label> <div align=\"left\"> <input type=\"submit\" name=\"button6\" id=\"button9\" value=\"Delete Picture\" /> <input type=\"hidden\" name=\"img[]\" value=\"$image_zero\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_one\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_two\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_four\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_five\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_six\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_seven\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eight\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_nine\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_ten\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eleven\"> <input type=\"hidden\" name=\"remove\" value=\"$image_three\"> <input type=\"hidden\" name=\"updel\" value=\"image_three\"> </div> </label> </form></td> </tr> <tr> <td><form id=\"form10\" name=\"form2\" method=\"post\" action=\"change_order.php\"> <label> <div align=\"left\"> <input type=\"submit\" name=\"button6\" id=\"button10\" value=\"Make Primary\" /> <input type=\"hidden\" name=\"img[]\" value=\"$image_three\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_zero\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_one\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_two\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_four\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_five\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_six\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_seven\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eight\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_nine\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_ten\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eleven\"> </div> </label> </form></td> </tr> </table>\n"; } if (!empty($rows[image_four])) { print " </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> <p> </p> <table width=\"0\" border=\"0\"> <tr> <td><table width=\"112\" height=\"129\" border=\"0\"> <tr> <td><img src=\"$imgff$image_four\" alt=\"\" width=\"156\" height=\"166\" /></td> </tr> <tr> <td><form id=\"form\" name=\"form1\" method=\"post\" action=\"..\p1c5_u91o4d\delete_image.php\"> <label> <div align=\"left\"> <input type=\"submit\" name=\"button\" id=\"button\" value=\"Delete Picture\" /> <input type=\"hidden\" name=\"img[]\" value=\"$image_zero\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_one\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_two\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_three\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_five\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_six\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_seven\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eight\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_nine\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_ten\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eleven\"> <input type=\"hidden\" name=\"remove\" value=\"$image_four\"> <input type=\"hidden\" name=\"updel\" value=\"image_four\"> </div> </label> </form></td> </tr> <tr> <td><form id=\"form2\" name=\"form2\" method=\"post\" action=\"change_order.php\"> <label> <div align=\"left\"> <input type=\"submit\" name=\"button\" id=\"button2\" value=\"Make Primary\" /> <input type=\"hidden\" name=\"img[]\" value=\"$image_four\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_zero\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_one\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_two\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_three\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_five\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_six\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_seven\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eight\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_nine\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_ten\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eleven\"> </div> </label> </form></td>\n"; } if (!empty($rows[image_five])) { print " </tr> </table></td> <td><table width=\"112\" height=\"129\" border=\"0\"> <tr> <td><img src=\"$imgff$image_five\" alt=\"\" width=\"156\" height=\"166\" /></td> </tr> <tr> <td><form id=\"form11\" name=\"form1\" method=\"post\" action=\"..\p1c5_u91o4d\delete_image.php\"> <label> <div align=\"left\"> <input type=\"submit\" name=\"button\" id=\"button11\" value=\"Delete Picture\" /> <input type=\"hidden\" name=\"img[]\" value=\"$image_zero\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_one\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_two\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_three\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_four\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_six\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_seven\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eight\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_nine\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_ten\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eleven\"> <input type=\"hidden\" name=\"remove\" value=\"$image_five\"> <input type=\"hidden\" name=\"updel\" value=\"image_five\"> </div> </label> </form></td> </tr> <tr> <td><form id=\"form12\" name=\"form2\" method=\"post\" action=\"change_order.php\"> <label> <div align=\"left\"> <input type=\"submit\" name=\"button\" id=\"button12\" value=\"Make Primary\" /> <input type=\"hidden\" name=\"img[]\" value=\"$image_five\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_zero\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_one\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_two\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_four\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_three\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_six\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_seven\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eight\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_nine\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_ten\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eleven\"> </div> </label> </form></td> </tr> </table></td>\n"; } if (!empty($rows[image_six])) { print " <td><table width=\"112\" height=\"129\" border=\"0\"> <tr> <td><img src=\"$imgff$image_six\" alt=\"\" width=\"156\" height=\"166\" /></td> </tr> <tr> <td><form id=\"form13\" name=\"form1\" method=\"post\" action=\"..\p1c5_u91o4d\delete_image.php\"> <label> <div align=\"left\"> <input type=\"submit\" name=\"button\" id=\"button13\" value=\"Delete Picture\" /> <input type=\"hidden\" name=\"img[]\" value=\"$image_zero\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_one\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_two\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_three\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_four\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_five\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_seven\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eight\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_nine\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_ten\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eleven\"> <input type=\"hidden\" name=\"remove\" value=\"$image_six\"> <input type=\"hidden\" name=\"updel\" value=\"image_six\"> </div> </label> </form></td> </tr> <tr> <td><form id=\"form14\" name=\"form2\" method=\"post\" action=\"change_order.php\"> <label> <div align=\"left\"> <input type=\"submit\" name=\"button\" id=\"button14\" value=\"Make Primary\" /> <input type=\"hidden\" name=\"img[]\" value=\"$image_six\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_zero\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_one\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_two\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_four\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_five\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_three\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_seven\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eight\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_nine\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_ten\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eleven\"> </div> </label> </form></td> </tr> </table></td> \n"; } if (!empty($rows[image_seven])) { print " <td><table width=\"112\" height=\"129\" border=\"0\"> <tr> <td><img src=\"$imgff$image_seven\" alt=\"\" width=\"156\" height=\"166\" /></td> </tr> <tr> <td><form id=\"form15\" name=\"form1\" method=\"post\" action=\"..\p1c5_u91o4d\delete_image.php\"> <label> <div align=\"left\"> <input type=\"submit\" name=\"button\" id=\"button15\" value=\"Delete Picture\" /> <input type=\"hidden\" name=\"img[]\" value=\"$image_zero\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_one\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_two\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_three\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_four\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_five\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_six\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eight\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_nine\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_ten\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eleven\"> <input type=\"hidden\" name=\"remove\" value=\"$image_seven\"> <input type=\"hidden\" name=\"updel\" value=\"image_seven\"> </div> </label> </form></td> </tr> <tr> <td><form id=\"form16\" name=\"form2\" method=\"post\" action=\"change_order.php\"> <label> <div align=\"left\"> <input type=\"submit\" name=\"button\" id=\"button16\" value=\"Make Primary\" /> <input type=\"hidden\" name=\"img[]\" value=\"$image_seven\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_zero\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_one\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_two\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_four\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_five\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_six\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_three\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eight\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_nine\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_ten\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eleven\"> </div> </label> </form></td> </tr> </table></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr>\n"; } if (!empty($rows[image_eight])) { print " <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> <p> </p> <table width=\"0\" border=\"0\"> <tr> <td><table width=\"112\" height=\"129\" border=\"0\"> <tr> <td><img src=\"$imgff$image_eight\" alt=\"\" width=\"156\" height=\"166\" /></td> </tr> <tr> <td><form id=\"form17\" name=\"form1\" method=\"post\" action=\"..\p1c5_u91o4d\delete_image.php\"> <label> <div align=\"left\"> <input type=\"submit\" name=\"button2\" id=\"button17\" value=\"Delete Picture\" /> <input type=\"hidden\" name=\"img[]\" value=\"$image_zero\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_one\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_two\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_three\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_four\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_five\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_six\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_seven\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_nine\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_ten\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eleven\"> <input type=\"hidden\" name=\"remove\" value=\"$image_eight\"> <input type=\"hidden\" name=\"updel\" value=\"image_eight\"> </div> </label> </form></td> </tr> <tr> <td><form id=\"form18\" name=\"form2\" method=\"post\" action=\"change_order.php\"> <label> <div align=\"left\"> <input type=\"submit\" name=\"button2\" id=\"button18\" value=\"Make Primary\" /> <input type=\"hidden\" name=\"img[]\" value=\"$image_eight\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_zero\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_one\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_two\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_four\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_five\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_six\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_seven\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_three\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_nine\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_ten\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eleven\"> </div> </label> </form></td>\n"; } if (!empty($rows[image_nine])) { print "</tr> </table></td> <td><table width=\"112\" height=\"129\" border=\"0\"> <tr> <td><img src=\"$imgff$image_nine\" alt=\"\" width=\"156\" height=\"166\" /></td> </tr> <tr> <td><form id=\"form19\" name=\"form1\" method=\"post\" action=\"..\p1c5_u91o4d\delete_image.php\"> <label> <div align=\"left\"> <input type=\"submit\" name=\"button2\" id=\"button19\" value=\"Delete Picture\" /> <input type=\"hidden\" name=\"img[]\" value=\"$image_zero\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_one\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_two\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_three\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_four\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_five\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_six\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_seven\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eight\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_ten\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_eleven\"> <input type=\"hidden\" name=\"remove\" value=\"$image_nine\"> <input type=\"hidden\" name=\"updel\" value=\"image_nine\"> </div> </label> </form></td> </tr> <tr> <td><form id=\"form20\" name=\"form2\" method=\"post\" action=\"change_order.php\"> <label> <div align=\"left\"> <input type=\"submit\" name=\"button2\" id=\"button20\" value=\"Make Primary\" /> <input type=\"hidden\" name=\"img[]\" value=\"$image_nine\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_zero\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_one\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_two\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_four\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_five\"> <input type=\"hidden\" name=\"img[]\" value=\"$image_six\"> & Hi I have inherited some code which has been placed on a new LAMP server, intended to replace an ageing system.The code uses the $_SERVER['REMOTE_USER'] variable but when ran through the Webrowser doesn't work. phpinfo() reveals that the $_SERVER['REMOTE_USER'] variable does not exist. It does exist though on the server where the code originally comes from. My problem is how to enable the use of $_SERVER['REMOTE_USER'] on this newly built server. Thanks in advance for any help. my problem is when i click on hyperlink it start copying it self insertrow=yes in address bar how to tackle this Code: [Select] $httpquery = "{$_SERVER['PHP_SELF']}?{$_SERVER['QUERY_STRING']}&insertrow=yes" ; <a href='{$httpquery}' >New</a> <br> if (isset($_GET['insertrow'])) { echo "<br> {$_GET['insertrow']} "; } |