Can I pass URL parameter values into webpage code to make the page display differently based on the URL Parameters? I.E. Embeded Google Drive Iframes?

38 views Asked by At

I am but a human and I would like to pass URL parameters into a page's iFrame code to get a different Google Drive iFrame to show to different customers. The idea is that we will have just one page but different to the people who view them. Is that possible?

Like in the code: <iframe src="https://drive.google.com/embeddedfolderview?(THIS BECOMES A DRIVE ID CUSTOM FIELD)#grid" style="width:100%; height:600px; border:0;"></iframe>

We want to deliver this link via email so when the user clicks the button it takes them to the page and loads the iframe with their folders on google drive in them.

the link on the email will be like:

https://customcreations.com/dashboard?driveID=(GOOGLE DRIVE ID TO POPULATE THE CUSTOM FIELD)

I am new sorry if this is not clear please let me know so I can clarify.

I tried having the id inside like a form that auto populates the iframe but it is breaking. I am really hoping this is possible.

Thank you to anyone who can help this mortal.

1

There are 1 answers

0
Hillel On

How about some php:

<?php
    $drive_id = htmlspecialchars($_GET["driveID"]);
    if (isset($drive_id)) {
        // echo start <iframe> code here...
        echo 'https://customcreations.com/dashboard?driveID=' , $drive_id;
        // echo rest of <iframe> code here...
    } else {
        echo 'Invalid ID';
    }
?>