-
Who's Online 1 Member, 0 Anonymous, 160 Guests (See full list)
All Activity
- Yesterday
-
Is this any use to you? <!DOCTYPE html> <html lang="en"> <head> <title>Wordle Assist</title> <meta charset="utf-8"> <script src="https://code.jquery.com/jquery-3.6.4.min.js"></script> <style type='text/css'> @media print { .printme { visibility: visible; display: block; } .noprint { visibility: hidden; } } #print { font-family: "times new roman", serif; font-size: 20pt; } #address { margin: 50px; line-height: 40px; } </style> <script type='text/javascript'> $(function() { if ($("#address").text() != '') { print() } }) </script> </head> <body> <div id='address' class='printme'> <?= nl2br($_GET['addy'] ?? '') ?> </div> <header class='noprint'> <h1>Address Labels</h1> </header> <form class='noprint'> Address:<br><br> <textarea cols='60' rows='5' name='addy'></textarea> <br><br> <button id=btnPrint'>Print</button> </form> </body> </html>
-
Hi Thanks for the replies. The printer is a small label printer assigned as default printer to the computer the viewer will use to see the page. Alternatively it could be put on the network with an IP. Pill the thread you linked shows how to generate a separate document, which could be done for each shipping label and then printing the label. I was trying to avoid having to go two steps for the users, which I guess you mean it is not possible with php. I will read more on print related commands of PHP and JS, meanwhile if you guys can think of a solution let me know. Thanks.
-
Thanks for that. Can't think how that was not copied down to the next line.
-
The closing </option> tag on the $ThisYear output is missing the closing >, so the following markup is broken. check the 'view source' of the output in your browser.
-
Hi. I have a drop down box that should show years 2024 and 2025. I can not get the next year to be included if today is greater than 19th November. Can any help with this please. This is on lines 134 - 139. The current date $DD $MM and $YYYY are automaticaly set anyway on lines 31 to 33. And the years are established on lines 53 to 55. <?php // Banking Version 2.0.0 01-12-2023 Desmond O'Toole. error_reporting(E_ALL); ini_set('display_errors', '1'); include_once ("secure/SecureFunctionsBankPDO.php"); include_once ("../secure/SecurePDO.php"); date_default_timezone_set('Europe/London'); session_start(); Session_Init(); $page = "Libray Selection"; if(!isset($_SESSION["Pk"])) { header('Location: index.php'); exit; } $Pk = $_SESSION["Pk"]; if(KeyCheckX($Pk)== 0) { header('Location: index.php'); exit; } $EndTime = KeyTestX($Pk, 0); //SILLY this returns 1 or -1 $_SESSION["current_page"] = $page; $Comment_Name = time(); $Comment_Name = dechex(time()); $_SESSION['COMMENT_NAME'] = $Comment_Name; $DD = date('d'); // Default to current date $MM = date('m'); $YYYY = date('Y'); $qBalance = GetBalance(); $Date = $qBalance['EntryDate']; $Value = $qBalance['BalanceValue']; $stamp = strtotime($Date); $_SESSION["DD_Balance"] = date('d' ,$stamp); $_SESSION["MM_Balance"] = date('m' ,$stamp); $_SESSION["YYYY_Balance"] = date('Y' ,$stamp); $_SESSION['C_Forward'] = $Value; $SE_MyReason = $_SESSION['DE_MyReason']; if($_SESSION["DE_DD_Entry"] == "") { $_SESSION["DE_DD_Entry"] = $DD; $_SESSION["DE_MM_Entry"] = $MM; $_SESSION["DE_YYYY_Entry"] = $YYYY; } $ThisYear = date("Y",time()); $NextYear = $ThisYear + 1; $PreviouseYear = $ThisYear - 1; if (!isset($_SESSION['DE_Money_In'])) $_SESSION['DE_Money_In'] = '0.00'; if (!isset($_SESSION['DE_Money_Out'])) $_SESSION['DE_Money_Out'] = '0.00'; if (!isset($_SESSION['DE_Comment'])) $_SESSION['DE_Comment'] = ""; $SE_Money_In = $_SESSION['DE_Money_In']; $SE_Money_Out = $_SESSION['DE_Money_Out']; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Bank Home 2</title> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <META http-equiv="imagetoolbar" CONTENT="no"> <link rel="stylesheet" href="stylesheets/Library.css" type="text/css"> <link rel="stylesheet" href="stylesheets/LibraryMenu.css" type="text/css"> </head> <body> <div id="PageTitle"> <img src="images/LibraryBanner.jpg" alt=""> </div> <?php include('SideMenu.php'); ?> <div id="PageContent"> <form action="DataInputUpdate.php" method="post"> <h3>User: <?=greeting() . " Ends on " . $EndTime ?></h3> <div style="width:650px;height:60px;padding:10px;overflow:hidden;"> <div style="width:440px;float:left;"> Date: Carried forward: £<span style="color:red;"><?=$_SESSION['Error_3'] ?></span> <input type="text" maxlength="10" size="5" name="BF" style="text-align:right" value="<?=$_SESSION['C_Forward'] ?>" > <select name="DD_Balance" style="width:40px"> <?php for($days=1;$days<32;$days++) { ?> <option value="<?=$days ?>" <?php if ($_SESSION["DD_Balance"] == $days){ ?> SELECTED <?php } ?>><?=$days ?></option> <?php } ?> </select> <select name="MM_Balance" style="width:60px"> <option value="1" <?php if ($_SESSION["MM_Balance"] == "1"){ ?> SELECTED <?php } ?>>Jan</option> <option value="2" <?php if ($_SESSION["MM_Balance"] == "2"){ ?> SELECTED <?php } ?>>Feb</option> <option value="3" <?php if ($_SESSION["MM_Balance"] == "3"){ ?> SELECTED <?php } ?>>Mar</option> <option value="4" <?php if ($_SESSION["MM_Balance"] == "4"){ ?> SELECTED <?php } ?>>Apr</option> <option value="5" <?php if ($_SESSION["MM_Balance"] == "5"){ ?> SELECTED <?php } ?>>May</option> <option value="6" <?php if ($_SESSION["MM_Balance"] == "6"){ ?> SELECTED <?php } ?>>Jun</option> <option value="7" <?php if ($_SESSION["MM_Balance"] == "7"){ ?> SELECTED <?php } ?>>July</option> <option value="8" <?php if ($_SESSION["MM_Balance"] == "8"){ ?> SELECTED <?php } ?>>Aug</option> <option value="9" <?php if ($_SESSION["MM_Balance"] == "9"){ ?> SELECTED <?php } ?>>Sep</option> <option value="10" <?php if ($_SESSION["MM_Balance"] == "10"){ ?> SELECTED <?php } ?>>Oct</option> <option value="11" <?php if ($_SESSION["MM_Balance"] == "11"){ ?> SELECTED <?php } ?>>Nov</option> <option value="12" <?php if ($_SESSION["MM_Balance"] == "12"){ ?> SELECTED <?php } ?>>Dec</option> </select> <select name="YYYY_Balance" style="width:60px"> <?php if($MM == 1) { ?> <option value="<?=$PreviouseYear ?>" <?php if($_SESSION["YYYY_Balance"] == $PreviouseYear){ ?> SELECTED <?php } ?> ><?=$PreviouseYear ?></option> <?php } ?> <option value="<?=$ThisYear ?>" <?php if($_SESSION["YYYY_Balance"] == $ThisYear){ ?> SELECTED <?php } ?> ><?=$ThisYear ?></option <?php if($MM == 12 || $MM == 11 && $DD > 19) { ?> <option value="<?=$NextYear ?>" <?php if($_SESSION["YYYY_Balance"] == $NextYear){ ?> SELECTED <?php } ?> ><?=$NextYear ?></option> <?php } ?> </select> </div> <br><br> <div style="float:left;clear:both;"><input class="MyButton"type="submit" name="direction" value="Prev Balance"></div> </div> <div style="width:650px;height:10px;padding:10px;overflow: hidden;"> <select name="DD_Entry" style="width:40px"> <?php for($days=1;$days<32;$days++) { ?> <option value="<?=$days ?>" <?php if ($_SESSION["DE_DD_Entry"] == $days){ ?> SELECTED <?php }?>><?=$days ?></option> <?php } ?> </select> <select name="MM_Entry" style="width:60px"> <option value="1" <?php if ($_SESSION["DE_MM_Entry"] == "1"){ ?> SELECTED <?php } ?>>Jan</option> <option value="2" <?php if ($_SESSION["DE_MM_Entry"] == "2"){ ?> SELECTED <?php } ?>>Feb</option> <option value="3" <?php if ($_SESSION["DE_MM_Entry"] == "3"){ ?> SELECTED <?php } ?>>Mar</option> <option value="4" <?php if ($_SESSION["DE_MM_Entry"] == "4"){ ?> SELECTED <?php } ?>>Apr</option> <option value="5" <?php if ($_SESSION["DE_MM_Entry"] == "5"){ ?> SELECTED <?php } ?>>May</option> <option value="6" <?php if ($_SESSION["DE_MM_Entry"] == "6"){ ?> SELECTED <?php } ?>>Jun</option> <option value="7" <?php if ($_SESSION["DE_MM_Entry"] == "7"){ ?> SELECTED <?php } ?>>July</option> <option value="8" <?php if ($_SESSION["DE_MM_Entry"] == "8"){ ?> SELECTED <?php } ?>>Aug</option> <option value="9" <?php if ($_SESSION["DE_MM_Entry"] == "9"){ ?> SELECTED <?php } ?>>Sep</option> <option value="10" <?php if ($_SESSION["DE_MM_Entry"] == "10"){ ?> SELECTED <?php } ?>>Oct</option> <option value="11" <?php if ($_SESSION["DE_MM_Entry"] == "11"){ ?> SELECTED <?php } ?>>Nov</option> <option value="12" <?php if ($_SESSION["DE_MM_Entry"] == "12"){ ?> SELECTED <?php } ?>>Dec</option> </select> <select name="YYYY_Entry" style="width:60px"> <?php if($MM == '1' && $DD < 7) { ?> <option value="<?=$PreviouseYear ?>" <?php if ($_SESSION["DE_YYYY_Entry"] == $PreviouseYear){ ?> SELECTED <?php } ?> ><?=$PreviouseYear ?></option> <?php } ?> <option value="<?=$ThisYear ?>" <?php if ($_SESSION["DE_YYYY_Entry"] == $ThisYear){ ?> SELECTED <?php } ?> ><?=$ThisYear ?></option> <?php if($MM > '10') { ?> <option value="<?=$NextYear ?>" <?php if ($_SESSION["YYYY_Balance"] == $NextYear){ ?> SELECTED <?php } ?> ><?=$NextYear ?></option> <?php } ?> </select> <span style="color:red;"><?=$_SESSION['Error_5'] ?></span> </div> <div style="width:650px;height:60px;padding:10px;overflow: hidden;"> Money in: £ <input style="text-align:right;" type="text" maxlength="10" size="4" name="MoneyIn" value="<?=$SE_Money_In ?>" size="8"> <!-- <span style="color:red;"><?=$_SESSION['Error_6'] ?></span> --> <br><br> Money Out: £ <input style="text-align:right;" type="text" maxlength="10" size="4" name="MoneyOut" value="<?=$SE_Money_Out ?>" size="8"> <!-- <span style="color:red;"><?=$_SESSION['Error_7'] ?></span> --> </div> <div style="width:650px;height:70px;padding:10px;overflow:hidden;"> Reason: <?php $qReason = GetReason(); ?> <select name="Reason"> <?php while($row = $qReason->fetch()) { ?> <option value="<?=$row['ReasonID'] ?>" <?php if($SE_MyReason == $row['ReasonID']) { ?> selected <?php } ?> ><?=$row['Reason'] ?></option> <?php } ?> </select> <span style="color:red;"><?=$_SESSION['Error_8'] ?><br><br></span> Comment <input type="text" maxlength="32" size="42" name= "<?=$Comment_Name ?>"; value=""> Max 32 Characters </div> <div style="width:650px;height:40px;padding:10px;overflow:hidden;"> Hi-light <input type="checkbox" maxlength="1" size="1" name="Bold"> </div> <div style="width:460px;height:90px;padding:10px;overflow:hidden;"> <input class="MyButton"type="submit" name="direction" value="Add record"><br><br><br> <input class="MyButton"type="submit" name="direction" value="Statement"> </div> </div> </form> </body> </html>
-
The architecture is completely different. VB programs run on the user's computer and so have access to everything connected to the user's computer. PHP applications run on a web server computer somewhere "out there", on The Web. Your PHP application cannot know anything about any printer, much less interact with them [directly] in any way. To "print" things these days, your PHP application sends document content to the user's web browser (running on the user's computer) and the user can choose to print it from there. For example: https://stackoverflow.com/questions/52410546/create-write-and-download-a-txt-file-using-php Regards, Phill W.
-
Where is the printer? Is it connected to the client or to the server? If it's connected to the client then the only thing you can do is present a print dialog. The user will have to choose the printer (potentially) and hit the button to print. If it's connected to the server then you can use a library to have PHP print the page. The details of that depend on what you're printing...
-
Hello everybody. What I am trying to do is add a button on a web page that clicking on it will send 3 lines of text (an address) directly to an assigned printer that prints labels. I recall from old days of using VB this was an easy task with that language. However I can not find any information about PHP or JS to do the same thing. Any ideas or examples would be highly appreciated.
-
The simple answer is probably also obvious: if you don't want to show the form under certain conditions (like after the form was submitted successfully) then don't show the form under those conditions. There's a bunch of different ways to go about it, but the one thing they all have in common is that there's an if statement that checks whether or not you want to show the form, and if you do then it shows the form. For example, if (/* show the form */) { ?> (the form) <?php }
- Last week
-
Hello Guys im using the code to update my password in my login system my question is how do i hide the form once it has been submitted so it just shows the echo message? <?php include('styles/top.php'); ?> <div id="left"> <img src="images/john.png" height="600px" width="300px" /> </div> <div id="right"> <div id="view_box"> <ul> <li><img src="images/1.png" /></li> <!-- <li><img src="pics/2.jpg" /></li> --> <!-- <li><img src="pics/3.jpg" /></li> --> </ul> </div> <div id="button"> <ul> <!-- <li><button class="button" scroll_value="0">*</button></li> -- > <!-- <li><button class="button" scroll_value="600">*</button></li> --> <!-- <li><button class="button" scroll_value="1200">*</button></li> --> </ul> </div> <hr /> <?php if (($user_level !=1 && $user_level !=2)){ echo " Coming Soon "; } else { if(isset($_POST['update'])) { $n_password = md5($_POST['n_password']); $c_password = md5($_POST['c_password']); if($c_password === $n_password) { $sql="update customers set password='$n_password' where username='$username'"; $res=mysqli_query($con,$sql); if($res) { //Password Successfully Changed. echo "Password Has Been Changed"; } else { //Sorry, Something went wrong, Please Try Again. echo "Sorry, Something went wrong, Please Try Again."; } } else { //Password do not Match. echo "Passwords do not match."; } } ?> <h2>Change Your Password</h2> <form action="" method="post"> <input type="password"”" name="n_password" placeholder="Enter new username" required> <input type="password" name="c_password" placeholder="Enter confirm password" required> <input type="submit" value="Submit" name="update"> </form> <?php } ?> </div> <?php include('styles/bottom.php'); ?>
-
Rashigandhi joined the community
-
Did you mean XAMPP? I'm sure a competent and experienced PHP developer could figure out whatever issue.
-
Php and Laravel prevent duplicate entries help please
gizmola replied to PNewCode's topic in PHP Coding Help
You should be able to use the unique constraint in the validator. return Validator::make($data, [ 'fname' => ['required', 'string', 'max:255', 'alpha'], 'username' => ['required', 'string', 'max:255', 'alpha_num', 'unique:User,email'], etc... What this does in Laravel, is that at validation time, Laravel will query the table to test for a row that exists with the same email that the user is trying to provide for this new registration. With that said, it is never a bad idea to enforce your desired database rules in the database, as Barand advised. Assuming this is mysql, you would do this for the email column of the user table, would be to create a unique index on the email column. Given that the system will be looking up users by the email column (as the username) there should be an index on that column anyways, but in this case the index should be unique. With mysql KEY and indexes are two ways of accomplishing the exact same thing. -
Since I can not get each of you lovely people a beer let me share with you this:
-
I am getting to this question late, and I see that people have been diligently working on it, but I do want to interject that the environment is very important here. Are you testing something locally, or even running a local app? Hopefully you are aware that the default behavior for php sessions is to set a cookie. Hopefully you are also aware that cookies are the responsibility of the client/browser to accept and once accepted, to return to the server in the HTTP header of every subsequent HTTP request. However, cookies also are relevant to a domain (and in some cases) to a subdomain. For security reasons, domains must have at least one dot in them, or browsers should not set the cookie. Because there is so much confusion regarding the use of localhost as an alias, and how it may or may not work as a domain, I never utilize it in development. I will use the .test TLD as it (along with a few others) has been designated as a TLD that will never be allowed. You are then free to odd domains and subdomains as you like, which you can put into your /etc/hosts file. I tend to use a project name, so I might set something like this up for project foo: // /etc/hosts file 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost 127.0.0.1 foo.test www.foo.test You can of course have as many of these aliases as you want added to each line. There are also tools people commonly use like dnsmasq to manage a home DNS setup and can even be used on your workstation, but that's far more complication than I want to bring up. In summary, again without full context here, this could be environmental, depending on where the server is running (and if this is a local/intranet server) .
-
foreach() function to replace each() function in while loop
gizmola replied to us66mo's topic in PHP Coding Help
Well, yes, because array_keys will provide you all the keys in the array at the first dimension, which is probably not what you wanted. If you want access to the key in the array you can use: foreach($tokenArr as $key => $val) { } Example: $fruits = array('a' => 'apple', 'b' => 'banana', 'o' => 'orange'); foreach ($fruits as $key => $val) { echo "The $key is one $val \n"; } Output is: The a is one apple The b is one banana The o is one orange -
do you have php's error_reporting and display_errors set so that php will help you by reporting and displaying all the errors it detects? error_reporting should always be set to E_ALL. on a live server, you can temporarily set display_errors to ON to get immediate feedback as to any problems. these settings should be in the php.ini on your system, but can temporarily be put in your php code, right after the first opening <?php tag. if php's output_buffering setting is on (another bad decision by php), you can have output before a header() statement and the header() will work. you should check using a phpinfo() statement to see what this setting is, as it also hides non-fatal php errors and any debugging output from your code. a full URL is not a problem. however, if the protocol changed, e.g. from https to http, the session won't match, because session cookies are kept per protocol. you are doing this on live web hosting? have you set your session_save_path to be to a location within your hosting directory tree, outside of/below the htdocs folder, so that all the session garbage collection by all the other hosting accounts isn't deleting your session data files? if your session data files are in the default tmp folder with all the other accounts, the shortest session.gc_maxlifetime of all those accounts is what will affect your session data files. the only user data you should store in a session variable upon login is the user id (autoincrement primary index.) you should query on each page request to get any other user data, such as a username, permissions, ... this is so that any changes made to this other user data will take effect on the very next page request after they have been changed. do you really want a situation where you have demoted or banned a user and they can continue to visit your web site because their session data says they can? and is this inside of code testing if a post method form has requested the page, so that it won't get executed just because a browser/client has made a get request to the page? browser's are now doing things like pre-requesting pages that are in your browser's search history when you start typing things in the address bar. also, a session can hold data other then who the logged in user is. you should only unset those session variable(s) that are specific to the logged in user. the code you have shown has the form processing code and the form on separate pages, with a bunch of extra redirects. this results in nearly 2x the amount of code, provides a bad User eXperience (UX), and depending on how you are getting data/messages back to the form, is open to phishing attacks and cross site scripting. the only redirects you should have in your application code are upon successful completion of post method form process and they should be to the exact same URL of the current page to cause a get request for that page. this will prevent the browser from trying to resubmit the form data should that page get browsed back to or reloaded, where someone can use the browser's developer tools to see what the form data, such as the password, is. the code for any form and related form processing should be on the same page. the code for any page should be laid out in this general order - initialization post method form processing get method business logic - get/produce data needed to display the page html document
-
jodunno thanks for your reply and being persistent in solving the problem. I corrected the redirect problem by removing all outputs and spaces. That solved one problem very well. The problem of sessions getting terminated by themselves still exist. (So redirect was not the cause of it.) I tested my pages at 9:15 this morning and everything was ok. At 9:20 I repeated the exact same tests with the same data and session does not work. In all years of my programming I have never seen such a thing. I am stating to think some crazy person in the hosting company is screwing with my code. I did not change anything from 9:15 to 9:20 so why is it not working now! Could disconnection from internet kill the sessions? A momentary disconnection is the only thing I can think of, although technically it shouldn't. Not only the session in progress is no longer working, I can not even create a new one while I can see Internet connection is working. So to summarize: what could prevent setting a new session if nothing is changed in code, browser, OS, username and password or anything else?
-
foreach() function to replace each() function in while loop
us66mo replied to us66mo's topic in PHP Coding Help
Excellent, thank you! Interesting that foreach (array_keys($tokenArr) as $val) I used elsewhere for similar code to be replaced did not work, but your code did. -
foreach() function to replace each() function in while loop
gizmola replied to us66mo's topic in PHP Coding Help
So you want something like this: foreach ($tokenArr as $val) { //... current code // bottom of foreach loop if ($errMess !== '') { break; } } -
foreach() function to replace each() function in while loop
mac_gyver replied to us66mo's topic in PHP Coding Help
the code's looping until there's an error (while no error). just use a foreach loop, with a break when the error occurs OR perhaps loop over all the data, producing an array of errors, then use the array of errors after the end of the loop? what does a sample of the data look like, what exactly are you doing with it, what do you want to do upon the first error or do you want to check every entry for errors? -
foreach() function to replace each() function in while loop
us66mo replied to us66mo's topic in PHP Coding Help
Thanks for the response! Here is the code for the while loop. "each" is combined with $errMess==" " : while (($errMess == "") && (list(,$val) = each($tokenArr))) { $this->log->notice(sprintf($SearchEngineConst['TokenInSequenceMsg'],$val["item"])); if ($val["type"] == "operand") { $this->log->notice(sprintf($SearchEngineConst['OperandPushedToArrayMsg'],$val["item"])); $tableName = getOrigTmpName(); if ($val["UnaryOp"] == "") { if (preg_match("/^\{(.*)\}$/",$val["item"],$arr)) { $val["item"] = $arr[1]; $this->getSelection($val["item"],$path,"folder",$tableName,$errMess); } else { $this->getSelection($val["item"],$path,"word",$tableName,$errMess); } } else { if (preg_match("/^\{(.*)\}$/",$val["item"],$arr)) { $val["item"] = $arr[1]; $this->getNotSelection($val["item"],$path,"folder",$tableName,$errMess); } else { $this->getNotSelection($val["item"],$path,"word",$tableName,$errMess); } } if ($errMess == "") { $val["item"] = $tableName; array_push($operandStack,$val); } } else if ($val["type"] == "operator") { $op1 = array_pop($operandStack); $op2 = array_pop($operandStack); if (($op1 == NULL) || ($op2 == NULL)) { $errMess = $errMessPrefix.$SearchEngineConst['EmptyOperandStackErrMsg']; $this->log->error($errMess); } if ($errMess == "") { $this->log->notice(sprintf($SearchEngineConst['ExecuteOperationMsg'],$val[item])); $this->log->notice(sprintf($SearchEngineConst['OperationInfoMsg'],$op1,$val[item],$op2)); $this->executeOperation($op1,$op2,$val["item"],$resOperand,$errMess); // old: $this->executeOperation($op1,$op2,$val["item"],&$resOperand,$errMess); } if ($errMess == "") { $this->log->notice(sprintf($SearchEngineConst['OperationResultMsg'],$resOperand[item])); array_push($operandStack,$resOperand); } } else { $errMess = $errMessPrefix.sprintf($SearchEngineConst['TokenTypeUnknownErrMsg'],$val[type]); $this->log->error($errMess); } } //END WHILE LOOP -
foreach() function to replace each() function in while loop
requinix replied to us66mo's topic in PHP Coding Help
(foreach isn't a function) It'd be easier to show if you posted the rest of the code instead of just a couple lines, but basically, replace the while loop with a foreach loop, and then add into it a little logic for $errMess. If that still doesn't make sense, post what you came up with (as well as the original code) so we can see what happened and not have to guess about it. -
foreach() function to replace each() function in while loop
us66mo posted a topic in PHP Coding Help
I am updating my website to PHP 8.2 and I am replacing, among other things, all each() functions. Most are quite easy to replace, but this code has me stumped. How do I replace each() here with a foreach() function. I tried double nesting 2 foreach() functions, but it didn't work. while (($errMess == "") && (list(,$val) = each($tokenArr))) { ... execution commands ... Any help would be greatly appreciated! Thanks! -
You've made the closing of the anchor tag conditional on the user being set. It shouldn't be. Assuming you want an anchor element that lacks its href attribute if the user isn't set, then use something like this: printf( '<a class="custom-btn custom-btn--small custom-btn--style-4"%s>Member Login</a>' , ( ( isset( $user ) && '' !== $user ) ? ' href="https://www.paratuberculosis.com/login.php"' : '' ) ); Personally, I'd omit the whole element, like this, but YMMV: if ( isset( $user ) && '' !== $user ) echo '<a class="custom-btn custom-btn--small custom-btn--style-4" href="https://www.paratuberculosis.com/login.php">Member Login</a>' ; Regards, Phill W.
-
php and apache trouble with http chunk encoding
requinix replied to Gaston's topic in Apache HTTP Server
You commented out the SetEnv?