|
I can make "Programming" in this code work as a link but I want the icon to be the link. I did come up with one solution but it deformed the icon when mousing over it.
<div class="col-lg-3">
<div class="features-icons-item mx-auto mb-5 mb-lg-0 mb-lg-3">
<div class="features-icons-icon d-flex">
class="icon-playlist m-auto text-primary">
</div>
<a href="#schedule">
<h3>Programming</h3>
</a>
<p class="lead mb-0">Schedule</p>
</div>
</div>
|
|
|
|
|
You just need to put the icon image between <a> and </a> .
Use a browser with dev tools to see what styling is applied on hover that is messing it up.
<a href- ... >;
<img src=...>
clickable words if you want
</a>
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
I'm trying to convert this function written in V4.7.3 to V7.4.
This function is used quite often in the app. I get what it does in a general sense, but not at expert level, because I lost my expert PHP database skills back in 2005.
I'm struggling to translate mssql_fetch_field. I tried sqlsrv_fetch_array and the result was 1. Then I tried sqlsrv_get_field and the result was 1.
The webpage errors say:
meta= 1
Notice: Trying to get property 'name' of non-object in C:\App\Dev\PCAD\class\cls_db_tools.php on line 137
Notice: Trying to get property 'name' of non-object in C:\App\Dev\PCAD\class\cls_db_tools.php on line 141
meta= 1
I don't understand the 1 that was returned. Obviously 1 doesn't contain a name, and I expected $meta to be a result.
And I don't have the old dev server to go back to to see what it's suppose to return with the old code.
Here's the old function
function db_Sel_Query($sqlQuery) {
<pre>
$Rows = Array();
$resQuery = mssql_query($sqlQuery) or die();
$cRows = mssql_num_rows($resQuery);
$cFields = mssql_num_fields($resQuery);
$rgFields = Array();
for ($i = 0; $i < $cFields; $i++) {
$meta = mssql_fetch_field($resQuery);
$rgFields[$i] = $meta->name;
}
for ($i = 0; $i < $cRows; $i++) {
$row = mssql_fetch_row($resQuery);
for ($col = 0;$col < $cFields;$col++) {
$Rows[$i][$rgFields[$col]] = rtrim($row[$col]);
}
}
mssql_free_result($resQuery);
return $Rows;
}
The new function I wrote
public static function dbSelectQuery($sqlQuery): array {
<pre>
$Rows = array();
$rgFields = array();
$params = array();
$options = array( "Scrollable" => SQLSRV_CURSOR_KEYSET );
$conn = clsDbConnect::createConn();
$resQuery = sqlsrv_query($conn, $sqlQuery, $params, $options) or die();
$rowCount = sqlsrv_num_rows($resQuery);
$fieldCount = sqlsrv_num_fields($resQuery);
for ($i = 0; $i < $fieldCount; $i++) {
$meta = sqlsrv_fetch_array($resQuery, SQLSRV_FETCH_ASSOC, $i);
echo "<div>meta= " . print_r($meta) . "</div>";
if ($meta->name) {
echo "<div>meta.name= $meta->name</div>";
}
$rgFields[$i] = $meta->name;
}
for ($i = 0; $i < $rowCount; $i++) {
$row = sqlsrv_fetch_array($resQuery,SQLSRV_FETCH_NUMERIC);
for ($col = 0; $col < $fieldCount; $col++) {
$Rows[$i][$rgFields[$col]] = rtrim($row[$col]);
}
}
sqlsrv_free_stmt($resQuery);
return $Rows;
}
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
I think I figured it out.
What I'm trying to get is the column names in the meta data of the table.
The example use a foreach loop, so now I know how to use foreach in PHP V7+
Seems needs some work and polishing.
public static function dbSelectQuery($sqlQuery): array {
<pre>
$Rows = array();
$rgFields = array();
$params = array();
$options = array( "Scrollable" => SQLSRV_CURSOR_KEYSET );
$conn = clsDbConnect::createConn();
$resQuery = sqlsrv_query($conn, $sqlQuery, $params, $options) or die(" cls_db_tools 128: " . $sqlQuery . print_r(sqlsrv_errors()) );
$rowCount = sqlsrv_num_rows($resQuery);
$fieldCount = sqlsrv_num_fields($resQuery);
$cIndex = 0;
foreach( sqlsrv_field_metadata( $resQuery ) as $fieldMetadata ) {
$columnName = $fieldMetadata['Name'];
$rgFields[$cIndex] = $columnName;
$cIndex++;
}
for ($i = 0; $i < $rowCount; $i++) {
$row = sqlsrv_fetch_array($resQuery,SQLSRV_FETCH_NUMERIC);
for ($col = 0; $col < $fieldCount; $col++) {
$Rows[$i][$rgFields[$col]] = rtrim($row[$col]);
}
}
sqlsrv_free_stmt($resQuery);
return $Rows;
}
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
I'm stumped, and sort of shocked that PHP didn't like the value or type.
$sold_date in the the sql server table is defined as smalldatetime.
In the table, the value is 2/7/2008
I tried $sold_date->format('m-d-y') and it didn't like it.
I also searched and searched, and just found generic anwsers
Fatal error: Uncaught Error: Object of class DateTime could not be converted to string in C:\App\Dev\PCAD\project_update.phtml:427 Stack trace: #0 {main} thrown in C:\App\Dev\PCAD\project_update.phtml on line 427
echo "
<td class='text-align-center'>
<p class='margin-text-indent'> $sold_date </p>
</td>";
My database call is
$row_proj = sqlsrv_fetch_array($res_proj);
$projectNumber = $row_proj[0];
$proj_stage = $row_proj[1];
$version_no = $row_proj[2];
$customerNumber = $row_proj[3];
$sold_date = $row_proj[4];
$sales_no = $row_proj[5];
$swan_job = $row_proj[6];
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
jkirkerx wrote: I tried $sold_date->format('m-d-y') and it didn't like it.
How did you try it? I suspect you'd need to use the "complex" syntax[^] to embed that within a string:
echo "
<td class='text-align-center'>
<p class='margin-text-indent'> {$sold_date->format('m-d-y')} </p>
</td>"; If that doesn't work, what error do you get?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Oh that works!
I would figured it out eventually, maybe within 3 months
Just read the link, did not know that.
I was thinking perhaps I had to preprocess that variable before echoing it out to the presentation layer.
Well that solves another 500 errors in this project, about 1000 more to go.
Thanks Richard, really appreciate the help. This project is really beating me up mentally, but it will be worth it in the end.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
Hello,
Sorry if i post this message at the wrong place.
I am making a website with a CMS. On this CMS i add my own little functions. For one of them i used an Ajax script to refresh a div but it doesn’t worked. I asked to the CMS creator he told me to use Pjax. Is it possible to do that ? (i don’t know pjax).
If someone can help me , it would be kind.
Thanks
modified 6-Feb-21 16:22pm.
|
|
|
|
|
This is the wrong place - try here: Ask a question[^] but try to give us actual information rather than your vague description. Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
Or better, go back to your CMS creator and ask him to elaborate.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
This is going to be really generic, but...
ASP.Net website hitting a sql server database.
Our web site hits a database and according to the sql server profiler, the stored proc is returning the requested data, but the response that we're seeing is a 500 error.
What might cause that?
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Any kind of unhandled exception in the code that follows on from calling the stored procedure.
Check the event log on the server - hopefully at least some details of the error should be logged there.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
We have five db/web server combinations running the same code. This is the only one that exhibits the problem. We found out that it was a 500 error by checking the logs. That's the first thing we checked to see if it was happening on the other servers.
We've been trying to resolve this for a week... non-stop...
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Assuming this isn't ASP.NET Core, the Windows application event log on the affected server should contain an entry for every unhandled exception thrown by your application.
Eg:
Log Name: Application
Source: ASP.NET 4.0.30319.0
Date: 05/02/2021 08:33:24
Event ID: 1309
Task Category: Web Event
Level: Warning
Keywords: Classic
User: N/A
Computer: ...
Description:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 05/02/2021 08:33:24
Event time (UTC): 05/02/2021 08:33:24
Event ID: 3517ee43b6ef4766b78e33194f895134
Event sequence: 19833
Event occurrence: 3
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/2/ROOT-1-132569484930082141
Trust level: Full
Application Virtual Path: /
Application Path: ...
Machine name: ...
Process information:
Process ID: 4920
Process name: w3wp.exe
Account name: IIS APPPOOL\.NET v4.5 (64-bit)
Exception information:
Exception type: InvalidOperationException
Exception message: Request format is unrecognized for URL unexpectedly ending in '/CountProducts'.
at System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath)
at System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)
at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Request information:
Request URL: ...
Request path: ...
User host address: ...
User:
Is authenticated: False
Authentication Type:
Thread account name: IIS APPPOOL\.NET v4.5 (64-bit)
Thread information:
Thread ID: 89
Thread account name: IIS APPPOOL\.NET v4.5 (64-bit)
Is impersonating: False
Stack trace: at System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath)
at System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)
at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Have you got health monitoring enabled? It works for WebForms and MVC.
ASP.NET Health Monitoring Overview | Microsoft Docs[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
We figured out what it was - database permissions. F*ckin DBA's...
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
<pre>Hi,
I am using the Live Server app, with VS Code. The issue I have is, as soon as I start coding, in the left column, the browser disappears, from the right.
Everything works fine, if I position/size VS Code/restore down Browser, side by side. Unfortunately that's with the browser working externally, from VS Code, not within its environment, the essence of the app.
The browser does automatically refresh but to see the refreshed/edited code, I have to access the browser from the taskbar, on laptop, unless I position the VS Code/browser together.
The whole concept of Visual Server, is to see edited code immediately, as I code.
Any suggestions would be greatly appreciated.
Ian
</pre>
|
|
|
|
|
Hi all...
just testing my new webhost, I made a new web project (Blazor, .NET5), clicked deploy and selected "FTP Passive" move.. what does the passive stands for...
It seems super slow.. going to try the.. "active"? deploy next!
EDIT
Seems marginally faster with "passive off"/"active". But maybe it's because I already built my app?
modified 4-Feb-21 8:14am.
|
|
|
|
|
On my customer PHP project, I've been tasked with upgrading it from PHP 4.7 to PHP 7.4.14. I decided not to take baby steps and do a giant leap since the app is so primitive, meaning it doesn't use any of the extensions such as image or anything clever.
I have 1000's of database queries using mssql_query, but I need to establish a connection first. Before I try to reinvent the wheel, thought it would be better to look at the wheels out there already first.
I'm not a PHP developer, nor do I work on WordPress, but could use a nudge in the right direction. Hoping there is something global. I saw something where I can add a PHP files called dbConnect, and PHP will load it on startup. But the documentation was kind of fuzzy to me.
All I've done so far was to do a test connection first, setup the environment, and start research on this.
I'm using PHP Storm
If it ain't broke don't fix it
Discover my world at jkirkerx.com
modified 2-Feb-21 14:54pm.
|
|
|
|
|
Hi,
My son is interested in coding and would like to learn web development. Which would be the best web development course for kids? Could someone please help me?
|
|
|
|
|
|
Whilst I try to refrain from printing emails, some are required and normally I use print pre-view to check what page(s) I need and select accordingly. If too complex as quick ctl A and copy paste to Word (or your favourite editor) and edit to the smallest number of pages possible.
However, just been caught out with a blood test appointment printed without checking and yes, three lines on the second page (of two sided print) that are not needed. Do Web designers have a secret contract with printer supplies for paper and ink? By the way, the email had masses of White Space!
Bah Humbug, waste of a sheet of paper.
|
|
|
|
|
I'm SMH on this.
Normally I really never look at the HTTP response payload and just assume it works. But this is a total hack on PHP 4.7 to tweak it to do modern things. I'm confused here, and really just looking for an explanation of why, so here goes.
I wrote this in PHP 4.7; being limited with what I can do, I hand crafted some JSON, and used a hack to encode it.
header('Content-Type: application/json; charset=utf-8');
$json = '{
"projectNumber":' . $sess_proj_no . ',
"projectStage":"' . $sess_proj_stage . '",
"newVersion":' . $new_version_no . ',
"undefinedValue":{
"projectNumber":"' . $projectNumber . '",
"variableContingencyCost":"' . $variableContingencyValue . '",
"variableContingencyValue":"' . $variableContingencyRate . '",
"actualPlusContingencyCost":"' . $actualPlusContingencyCost . '"
}
}';
$jsonTest = '{ "test": "result" }';
$jsonEncode = json_encode($jsonTest);
echo $json;
ob_end_flush();
With encoding, adding slashes to the double quotes,
SyntaxError: JSON.parse: expected property name or '}' at line 2 column 13 of the JSON data
"{
\"projectNumber\":2549,
\"projectStage\":\"engineering\",
\"newVersion\":0,
\"undefinedValue\":{
\"projectNumber\":\"\",
\"variableContingencyCost\":\"\",
\"variableContingencyValue\":\"\",
\"actualPlusContingencyCost\":\"\"
}
}"
Without encoding, no slashes to the double quotes, I get a clean HTTP response payload without errors.
{
"projectNumber": 2549,
"projectStage": "engineering",
"newVersion": 0,
"undefinedValue": {
"projectNumber": "",
"variableContingencyCost": "",
"variableContingencyValue": "",
"actualPlusContingencyCost": ""
}
}
I always thought JSON had to be encoded during transport, and then decoded to consume it.
Unless json_encode is meant to convert JSON created with a class, into a string without slashes. or it has something to do with echo and just spitting out text.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
According to my reading of the PHP manual, json_encode() didn't exist before PHP 5.2.0.
So I have no idea what you're using in 4.7....
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
|
It looks like you are creating a string in JSON format, then passing it to json_encode() where it is trying to turn it into more JSON. Unless you are actually trying to embed your JSON in the JSON that json_encode() produces, that doesn't make much sense.
This is how json_encode() is supposed to work:
$data = array(
"projectNumber" => $sess_proj_no,
"projectStage" => $sess_proj_stage,
"newVersion" => $new_version_no,
"undefinedValue" => array(
"projectNumber" => $projectNumber,
"variableContingencyCost" => $variableContingencyValue,
"variableContingencyValue" => $variableContingencyRate,
"actualPlusContingencyCost" => $actualPlusContingencyCost,
),
);
$json = json_encode($data);
|
|
|
|
|
Oh!
Wow thanks, I had no idea. That makes sense.
Will give it a try!
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|