web hosting – Why doesn’t my HTML PHP file upload form work on my website?

I have an HTML PHP website hosted on SiteGround, which I read somewhere uses UNIX servers. I created a file upload form for a job application webpage and I’ve tried every code example that I found online (that works for them but obviously not for me).

I even changed the folder and file permissions. Yet I still cannot manage to upload a simple PNG image file in testing. The tutorials and examples that I’ve found online are somewhat outdated.

Here is the code for the form.html file:

<!DOCTYPE html>
<html>
<body>
<form enctype="multipart/form-data" action="upload.php" method="post">
<p>Upload your file:</p>
<input type="file" name="uploaded_file">
<input type="submit" value="Upload">
</form>
</body>
</html>

Here is the code for the upload.php file:

<?php
$target_dir = "uploads/";
$target_file = $target_dir . basename($_FILES('uploaded_file')('name'));
if(move_uploaded_file($_FILES('uploaded_file')('tmp_name'),$path)){
    echo "The file ".  basename($_FILES('uploaded_file')('name')). " has been uploaded";
}
else{
    echo "Your file was unable to upload. Please try again.";
$uploadOk = 0;
}
?>

I do have a folder named “uploads” in the same directory on the server.

javascript – Draw triangles on the HTML canvas optimization

There is a function that draws triangles on the canvas area in each lines:

    function DivotTemplate(divot, canvas) {
        if (divot === void 0) { divot = defaultConfig; }
        var config = __assign(__assign({}, defaultConfig), divot);
        var ctx = canvas.getContext('2d');
        if (!ctx)
            throw Error('Canvas context error');
        var width = canvas.width;
        var height = canvas.height;
        var step = config.step, radius = config.radius, strokeStyle = config.strokeStyle, triangleWidth = config.triangleWidth;
        var x = (1, 1, triangleWidth + 1);
        var y = (1, triangleWidth, triangleWidth / 2);
        var context = canvas.getContext('2d');
        if (!context)
            throw Error('Canvas context error');
        /* Рисуем три точки для первого треугольника */
        for (var c = 0; c < height; c++) {
            if (c % 2 === 0) {
                x(0) = triangleWidth + 1;
                x(1) = triangleWidth + 1;
                x(2) = 1;
            }
            else {
                var s = step / 2;
                x = (1 + s, 1 + s, triangleWidth + 1 + s);
            }
            for (var i = 0; i < width; i = i + step) {
                context.beginPath();
                context.arc(x(0), y(0), radius, 0, 2 * Math.PI, false);
                context.strokeStyle = strokeStyle;
                context.stroke();
                context.beginPath();
                context.arc(x(1), y(1), radius, 0, 2 * Math.PI, false);
                context.strokeStyle = strokeStyle;
                context.stroke();
                context.beginPath();
                context.arc(x(2), y(2), radius, 0, 2 * Math.PI, false);
                context.strokeStyle = strokeStyle;
                context.stroke();
                /* Соединяем две точки из трех */
                context.beginPath();
                context.moveTo(x(2), y(2));
                context.lineTo(x(0), y(0));
                context.strokeStyle = strokeStyle;
                context.stroke();
                context.beginPath();
                context.moveTo(x(2), y(2));
                context.lineTo(x(1), y(1));
                context.strokeStyle = strokeStyle;
                context.stroke();
                x(0) = x(0) + step;
                x(1) = x(1) + step;
                x(2) = x(2) + step;
            }
            x = (1, 1, triangleWidth + 1);
            y(0) = y(0) + step;
            y(1) = y(1) + step;
            y(2) = y(2) + step;
        }
        return canvas;
    }
There is a function that draws triangles on the canvas area in each lines:

function DivotTemplate(divot, canvas) {
    if (divot === void 0) { divot = defaultConfig; }
    var config = __assign(__assign({}, defaultConfig), divot);
    var ctx = canvas.getContext('2d');
    if (!ctx)
        throw Error('Canvas context error');
    var width = canvas.width;
    var height = canvas.height;
    var step = config.step, radius = config.radius, strokeStyle = config.strokeStyle, triangleWidth = config.triangleWidth;
    var x = (1, 1, triangleWidth + 1);
    var y = (1, triangleWidth, triangleWidth / 2);
    var context = canvas.getContext('2d');
    if (!context)
        throw Error('Canvas context error');
    /* Рисуем три точки для первого треугольника */
    for (var c = 0; c < height; c++) {
        if (c % 2 === 0) {
            x(0) = triangleWidth + 1;
            x(1) = triangleWidth + 1;
            x(2) = 1;
        }
        else {
            var s = step / 2;
            x = (1 + s, 1 + s, triangleWidth + 1 + s);
        }
        for (var i = 0; i < width; i = i + step) {
            context.beginPath();
            context.arc(x(0), y(0), radius, 0, 2 * Math.PI, false);
            context.strokeStyle = strokeStyle;
            context.stroke();
            context.beginPath();
            context.arc(x(1), y(1), radius, 0, 2 * Math.PI, false);
            context.strokeStyle = strokeStyle;
            context.stroke();
            context.beginPath();
            context.arc(x(2), y(2), radius, 0, 2 * Math.PI, false);
            context.strokeStyle = strokeStyle;
            context.stroke();
            /* Соединяем две точки из трех */
            context.beginPath();
            context.moveTo(x(2), y(2));
            context.lineTo(x(0), y(0));
            context.strokeStyle = strokeStyle;
            context.stroke();
            context.beginPath();
            context.moveTo(x(2), y(2));
            context.lineTo(x(1), y(1));
            context.strokeStyle = strokeStyle;
            context.stroke();
            x(0) = x(0) + step;
            x(1) = x(1) + step;
            x(2) = x(2) + step;
        }
        x = (1, 1, triangleWidth + 1);
        y(0) = y(0) + step;
        y(1) = y(1) + step;
        y(2) = y(2) + step;
    }
    return canvas;
}

I measured the performance of this function and get bad indicators (pic. 1)

Timeline display for code

How it can be improved?

Why context.strokeStyle = strokeStyle; takes over 4 seconds?

Maybe pull out context.beginPath(); outside of loop? Or combine some operators? How to optimize canvas drawing?

html – Please bring the title of the new question to here (I have edited the body of the question already)

html – Please bring the title of the new question to here (I have edited the body of the question already) – Webmasters Stack Exchange

Simplify function to blend HTML into PHP

I’m always down to learn better ways of doing thing and I wanted to see if I can get an input from the community to see if there is a way that I can improve this function:

function pardot_dashboard_query()
{
    $args = (
        's'         => '<!-- wp:acf/pardot-form ',
        'sentence'  => 1,
        'post_type' => (
            'post',
            'page'
        ),
    );
    $pardot_posts = get_posts($args);
    if (!$pardot_posts) {
        echo 'There are no active Pardot Forms.';
        return;
    }
    echo '<p>The Pardot Form is active on the following pages/posts:</p>'; ?>
    <ul>
        <?php foreach ($pardot_posts as $post): ?>
            <li><a href="<?= $post->guid ?>"><?= $post->post_title ?: 'No title available' ?><?= ' (' . ucfirst($post->post_type) . ')' ?></a></li>
        <?php endforeach; ?>
    </ul>
    <?php
}

If there are other means of outputs and or ways to shrink it down – All help will be appreciated!

html – Best SEO-friendly approach for icon links?

I’m having trouble finding info on this. I’d like to know what is the best way to markup icon links so Search Engines can make sense of it. Google’s validator tools seem to ignore title attributes.

The following are 2 cases for icon link formatting I tend to use (be it in breadcrumbs or in other navigation elements)—using CSS ::pseudo element on a <span> or <i> tag, or styling a character by applying the @font-face icon font to it.

I also started implementing JSON-LD in my project, so for things like breadcrumbs, setting the "ListItem" "name" seems to tell Google what the name of the link is—at least the validator recognizes it in the JSON-LD code. When combined with RDFa or other Microdata, Google did not recognize the name without a hack, so I’m sticking to just JSON-LD for now.

I’m not sure about other search engines, as well as best general practices when using icons for links, and if using JSON-LD makes the HTML markup irrelevant.

Case 1: CSS Pseudo Element

<ol id="breadcrumbs">
    <li><a href="/" title="Home"><span class="icon-home"></span></a>&nbsp; &gt;</li>
    <li><a href="/collection-page/" id="collection-page">Collection Page</a>&nbsp; &gt; </li>
    <li><span class="current-page">Current Page</span></li>
</ol>
<style>
    .icon-home::before { font-family:'my-icon-font'; }
</style>

Case 2: A character being directly styled

<ol id="breadcrumbs">
    <li><a class="b-home" href="/" title="Home">H</a>&nbsp; &gt;</li>
    <li><a href="/collection-page/" id="collection-page">Collection Page</a>&nbsp; &gt; </li>
    <li><span class="current-page">Current Page</span></li>
</ol>
<style>
    .b-home { font-family:'my-icon-font'; }
</style>

JSON-LD

<script type="application/ld+json">
    {
        "@context": "https://schema.org/",
        "@type": "BreadcrumbList",
        "@id": "https://example.com/collection-page/current-page/#breadcrumbs",
        "itemListElement": (
            {
                "@type": "ListItem",
                "position": 1,
                "name": "Home",
                "item": "https://example.com/"
            },{
                "@type": "ListItem",
                "position": 2,
                "name": "Collection Page",
                "item": "https://example.com/collection-page/"
            },{
                "@type": "ListItem",
                "position": 3,
                "name": "Current Page"
            }
        )
    }
</script>

javascript – Is there a site where you can do a drag and drop web design(like elementor) and then you can export the html out of it?

javascript – Is there a site where you can do a drag and drop web design(like elementor) and then you can export the html out of it? – Web Applications Stack Exchange

javascript – Import a local JSON file in your pc to your basic HTML page and display it’s content using Chart.js API

javascript – Import a local JSON file in your pc to your basic HTML page and display it’s content using Chart.js API – Webmasters Stack Exchange

sharepoint online – display html in multiline column

Just assuming the answer will be simply “you cannot”, but I would give a try:
I would like to keep my team up-to-date with the latest messages from MS.
They look like:

{
id": "MC283609",
"category": "planForChange",
"severity": "normal",
    "body": {
      "contentType": "html",
      "content": "<p>We are introducing an improved support experience... </p><a href="https://aka.ms/EndpointManager-support-experience" target="_blank">https://aka.ms/EndpointManager-support-experience</a></p>"
    }
 }

I would like to put these in a SharePoint list. The body content is simple html. I would like to present this also in the list as html in a Multiple lines of text column. Is this possible? When I just paste this text, SharePoint turns it to string.

html – Is it a good practice to wrap buttons on a div?

html – Is it a good practice to wrap buttons on a div? – Software Engineering Stack Exchange

google apps script – Adding HTML into an Appscript upon edit

I’m very new at this and this is driving me crazy. I’ve got an email that populates when the sheet is edited, and I don’t want the strange line breaks in the email, so I guess that HTML is the way to go. My code is this:

function processEdit(e) {
MailApp.sendEmail({
to:”me@gmail.com”,
subject: “The Saleable Indicator Report has been Updated”,
body: “Please go into the Parts Purchasing tab in the Saleable Indicator Report Folder and see the changes.nnMake sure to Supersede parts that are active in your branch to the new part numbers.nnThank you so much!”
});
}

But it comes out as this with the line breaks:

Please go into the Parts Purchasing tab in the Saleable Indicator
Report Folder and see the changes.

Make sure to Supersede parts that are active in your branch to the new part
numbers.

Thank you so much!


I am not savvy at this, but the videos and tutorials get me way off track since I’m not looking to send this to a lot of people or the names in the sheet. Any help would be appreciated.

DreamProxies - Cheapest USA Elite Private Proxies 100 Cheap USA Private Proxies Buy 200 Cheap USA Private Proxies 400 Best Private Proxies Cheap 1000 USA Private Proxies 2000 USA Private Proxies 5000 Cheap USA Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive.com Proxies-free.com New Proxy Lists Every Day Proxies123.com Best Quality USA Private Proxies