pentego
Forum Replies Created
-
The send_pdf.php script is here: https://pastebin.com/KJf563kH
Sorry, did not know about policy that requires php code to go to pastebin…
Jerry
Now, the real trick would be to have it tied to the submit button….
Anyone know how I could do that ???
Jerry
Mike, thanks.
Here is an updated version. Works better.
First, the window.open line has changed.
window.open("/path_to_PHP_script/send_pdf.php?pdf=" + '$shortcode_send_pdf', "_blank", "width=100, height=100");
The script “send_pdf.php” is
[Code moderated as per the Forum Rules. Please use the pastebin]Sorry, goofed.. only 3 changes.
GOT IT!!!!!
Here are the changes in case someone else wants to do it as well.
In your document, the shortcode is
[si-contact-form form=’3′ send_pdf=’new_URL’ redirect=’URL’]in ‘si-contact-form.php’ file, there are 4 changes:
1) at about line 454, add “‘send_pdf’ => ”,” to the list.————
extract(shortcode_atts(array(
‘form’ => ”,
‘redirect’ => ”,
‘send_pdf’ => ”,
‘hidden’ => ”,
’email_to’ => ”,
), $atts));
————–2) at about line 470 add “$shortcode_send_pdf = $send_pdf;”
————-
// https://www.fastsecurecontactform.com/shortcode-options
$shortcode_redirect = $redirect;
$shortcode_send_pdf = $send_pdf;
$shortcode_hidden = $hidden;
$shortcode_email_to = $email_to;
————-3) at about line 758, add this
if(‘$shortcode_send_pdf’ != ”)
window.open(‘$shortcode_send_pdf’, “_blank”, “toolbar=no, location=no, directories=no, status=no, menubar=no, width=400, height=400”);
so the function ctf_redirect() looks like this—————-
function ctf_redirect() {
document.title=’Redirecting in ‘ + ctf_redirect_seconds + ‘ seconds’;
ctf_redirect_seconds=ctf_redirect_seconds-1;
ctf_redirect_time=setTimeout(“ctf_redirect()”,1000);
if (ctf_redirect_seconds==-1) {
clearTimeout(ctf_redirect_time);
document.title=’Redirecting …’;
self.location=’$ctf_redirect_url’;
if(‘$shortcode_send_pdf’ != ”)
`window.open(‘$shortcode_send_pdf’, “_blank”, “toolbar=no, location=no, directories=no, status=no, menubar=no, width=400, height=400”);
}
}
—————-So, just a thought,
instead of ‘send_pdf’, is there a way to have the redirect open a new window with some specified URL and then, redirect to the URL specified in the ‘redirect’ shortcode option?
sort of like this
[si-contact-form form=’3′ open=’new_URL’ redirect=’URL’]
is this doable ?
A little more.
I have tried to edit the si-contact-form.php at about line 448 and added:
————
extract(shortcode_atts(array(
‘form’ => ”,
‘redirect’ => ”,
‘send_pdf’ => ”,
‘hidden’ => ”,
’email_to’ => ”,
), $atts));
—————–with the change being ‘send_pdf’.
Also, edited line 464 to add
————-
$shortcode_send_pdf = $send_pdf;
————-I also edited the line around 745 to include the pdf name on the page title
————–
document.title=’Redirecting in ‘ + $shortcode_send_pdf + ‘ — ‘+ ctf_redirect_seconds + ‘ seconds’;
————–But, the title does not get the pdf name, the redirect just hangs…
Any help would be great.
Jerry