Jump to content

WilliamGrant

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

WilliamGrant's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. To explain the function of the script.. Basically, The visitor clicks on a download button to get their mp3 file and when they do, the page freezes and an offer from our sponsor will appear on the screen asking them if they are interested in the offer. If they are not interested, they can close it to download their file. The offer is triggered with a piece of javascript. The javascript itself is placed below the <body tag> I suppose there are ways to make javascript work within php, I'll have to figure it out.
  2. Hi, Your help is definitely much appreciated. I have been trying to implement your idea and what appears to happen is that I get a blank page in my browser. If you would not mind I will share with you the full php part. I am trying to implement your idea into this part of the script. <?php // On form submission... if ($_POST['submit']) { // Print "please wait" message and preview image echo '<div id="preview" style="display:block"><p>...Please wait while I try to convert:</p>'; echo '<p><img src="http://img.youtube.com/vi/'.$converter->ExtractVideoId(trim($_POST['youtubeURL'])).'/1.jpg" alt="preview image" /></p>'; echo '<p>'.$converter->ExtractSongTrackName(trim($_POST['youtubeURL']), 'url').'</p>'; echo '<div id="progress-bar"><div id="progress">0%</div></div></div>'; flush(); // Main Program Execution if ($converter->DownloadVideo(trim($_POST['youtubeURL']))) { echo ($converter->GenerateMP3($_POST['quality'])) ? '<p>Success!</p><p><a href="'.$_SERVER['PHP_SELF'].'?mp3='.urlencode(trim(strstr($converter->GetSongFileName(), '/'), '/')).'">Download your File.</a></p>' : '<p>Error generating File!</p>'; } else { echo '<p>Error downloading video!</p>'; } } ?>
  3. Hey guys, Im trying to make the following work.. I have this piece of code as a link: <a href="'.$_SERVER['PHP_SELF'].'?mp3='.urlencode(trim(strstr($converter->GetSongFileName(), '/'), '/')).'">Download your File.</a> and I have this piece of javascript: <a href="#" onClick="javascript:initGateway(); return false;">Click here</a> I need to blend these to together into one single <a href=""> so that when you click the link, both functions will be activated. Your help would be much appreciated. So far I haven't been able to pull it off.. I tried the following but without result : <a href="'.$_SERVER['PHP_SELF'].'?mp3='.urlencode(trim(strstr($converter->GetSongFileName(), '/'), '/')).';initGateway(); return false;">Download your MP3 file.</a> Thanks a lot
  4. Hey Guys, I'm working on a website. It is running an ad when a download button is clicked and I can't get it to work so far. I'll try to explain the problem in a simple matter. There is a link that says "Download your file here" Since this file was first generated by the visitor and stored on the server, the link to the file looks like : <a href=download.php?f=".$loca."> But before the visitor has access to this file, the page should lock and show an ad as soon as they click "The Download your file" button.. This is the code to call the ad: onclick="startGateway('XXXXXXX');" This is the javascript for the ad: <script type="text/javascript" src="http://www.advertisersite.com/gwjs.php?pub=XXXXXX"></script><noscript> What I need is a script for the download button that will first call the ad and then call the url to the download : download.php?f=".$loca." So far I haven't been able to make this work but any help will be greatly appreciated. I hope my question is clear. If not, let me know Thanks a bunch!
  5. I just tested it and it works beautifully! You have been a great help Pawn, Thanks a lot! If you ever need something graphical, pm me. I'm a graphic designer
  6. Hey guys, how do I send checkbox variables to my e-mail address once a user has checked it on the html form. Here is my html form: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Form</title> <script type="text/javascript"> //email form validation function everif(str) { var at="@" var punct="." var lat=str.indexOf(at) var lstr=str.length var lpunct=str.indexOf(punct) if (str.indexOf(at)==-1){ alert("Valid email must be entered") return false } if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ alert("Valid email must be entered") return false } if (str.indexOf(punct)==-1 || str.indexOf(punct)==0 || str.indexOf(punct)==lstr){ alert("Valid email must be entered") return false } if (str.indexOf(at,(lat+1))!=-1){ alert("Valid email must be entered") return false } if (str.substring(lat-1,lat)==punct || str.substring(lat+1,lat+2)==punct){ alert("Valid email must be entered") return false } if (str.indexOf(punct,(lat+2))==-1){ alert("Valid email must be entered") return false } if (str.indexOf(" ")!=-1){ alert("Valid email must be entered") return false } return true } function evalid(){ var emailID=document.contact_form.mail if (everif(emailID.value)==false){ emailID.focus() return false } //empty field validation var naam=document.contact_form.naam if ((naam.value==null)||(naam.value=="")){ alert("Fields marqued with * must be entered") naam.focus() return false } var telefoon=document.contact_form.telefoon if ((telefoon.value==null)||(telefoon.value=="")){ alert("Fields marqued with * must be entered") telefoon.focus() return false } var branche=document.contact_form.branche if ((branche.value==null)||(branche.value=="")){ alert("Fields marqued with * must be entered") branche.focus() return false } return true } </script> </head> <body> <form name="contact_form" method="post" id="contactform" action="doeactie.php" onSubmit="return evalid()"> <table border="0"> <tr> <td><label for="bedrijfsnaam">Company name</label></td> <td colspan="2"><input name="bedrijfsnaam" type="text" class="text" size="30" /></td> </tr><tr> <td><label for="naam">Name *</label></td> <td colspan="2"><input name="naam" type="text" class="text" size="30" /></td> </tr><tr> <td><label for="mail">E-mail *</label></td> <td colspan="2"><input type="text" name="mail" class="text" size="30" /></td> </tr><tr> <td><label for="adres">Address</label></td> <td colspan="2"><input name="adres" type="text" class="text" size="30" /></td> </tr><tr> <td><label for="plaatsnaam">City</label></td> <td colspan="2"><input name="plaatsnaam" type="text" class="text" size="30" /></td> </tr><tr> <td><label for="postcode">Zip</label></td> <td colspan="2"><input type="text" name="postcode" class="text" size="10" /></td> </tr><tr> <td><label for="branche">Niche *</label></td> <td colspan="2"><input name="branche" type="text" class="text" size="30" /></td> </tr><tr> <td><label for="telefoon">Phone *</label></td> <td colspan="2"><input name="telefoon" class="text" type="text" size="30" /></td> </tr><tr> <td><label for="bericht">Question or Comment</label></td> <td colspan="2"><textarea name="message" class="text" onkeyup="return limitarelungime(this, 255)" cols="35" rows="5"></textarea></td> </tr> </table> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td></td> <td height="25"></td> </tr> <tr> <td></td> <td height="30" valign="top"><font face="arial" size="2"><b>I would also like to receive information about :</b></font></td> </tr> <tr> <td><input type="checkbox" name="emailmarketing" id="emailmarketing" value="emailmarketing" /></td> <td height="25"><font face="arial" size="2">E-mail Campaign</font></td> </tr> <tr> <td><input type="checkbox" name="zoekmachopt" id="zoekmachopt" value="zoekmachopt" /></td> <td height="25"><font face="arial" size="2">SEO</font></td> </tr> <tr> <td><input type="checkbox" name="socialmedia" id="id" value="socialmedia" /></td> <td height="25"><font face="arial" size="2">Social Media</font></td> </tr> <tr> <td><input type="checkbox" name="videomarketing" id="videomarketing" value="videomarketing" /></td> <td height="25"><font face="arial" size="2">Video Marketing</font></td> </tr> <tr> <td><input type="checkbox" name="webshop" id="webshop" value="webshop" /></td> <td height="25"><font face="arial" size="2">Webshop</font></td> </tr> <tr> <td><input type="checkbox" name="cms" id="cms" value="cms" /></td> <td height="25"><font face="arial" size="2">Content Management System</font></td> </tr> <tr> <td><input type="checkbox" name="grafisch" id="grafisch" value="grafisch" /></td> <td height="25"><font face="arial" size="2">Graphic Design</font></td> </tr> <tr> <td></td> <td align="left"><br /><input type="submit" name="Submit" value="Send"></td> <td align="right"></td> </tr> </table> </form> </body> </html> and this is the PHP script that processes this. Everything works except for the checkbox part. <?php session_start(); if(isset($_POST['Submit'])) { $youremail = 'blabla@gmail.com'; $fromsubject = 'Request from form'; $bedrijfsnaam = $_POST['bedrijfsnaam']; $naam = $_POST['naam']; $mail = $_POST['mail']; $adres = $_POST['adres']; $plaatsnaam = $_POST['plaatsnaam']; $postcode = $_POST['postcode']; $branche = $_POST['branche']; $telefoon = $_POST['telefoon']; $message = $_POST['message']; $to = $youremail; $mailsubject = 'Bericht ontvangen van'.$fromsubject.' Actie Pagina'; $body = $fromsubject.' Bedrijfsnaam: '.$bedrijfsnaam.' Naam Contact Persoon: '.$naam.' E-mail: '.$mail.' Adres: '.$adres.' Plaatsnaam: '.$plaatsnaam.' Postcode: '.$postcode.' Branche: '.$branche.' Telefoonnummer: '.$telefoon.' vraag of Wens: '.$message.' |---------End Message----------|'; echo "thank you for your request we will contact you asap."; mail($to, $subject, $body); } else { echo "Error Please <a href='form.html'>try again</a>"; } ?> Any help would be great! Thanks guys
  7. Hi Chad! Thanks for you reply! This certainly looks like the direction I need. Would you mind expanding a little bit on this idea? I'll be honest, I'm a graphic designer and learning my way into PHP but I'm really not that good at it (yet) haha Anyway, If you could direct me a little in where I should I place that "if statement" and how I can make it appear in my e-mail box like you said, I would technically be done with my website finally :-) right now the output of a mail being sent to me through the form looks something like: Name : jreklgfjer Address : fjerkfn Phone : 572348953 So I think when a box was checked it should appear something like this in my mailbox additional boxes checked: Cookies Chocolate Pie I hope this makes sense lol Much thanks! William
  8. Hey guys, So basically I created a page where people fill out some information such as their name, e-mail, phonenumer etc. This works perfectly by now. I also would like them to be able to check 6 checkboxes as optional fields something like: "I like to eat : (checkbox 1 ) cookies - (checkbox 2 ) chocolate .. etc" So when I give each html checkbox a name and id such as "cookies" how do I process this information in my php formscript? would it look like this? <?php session_start(); if(isset($_POST['Submit'])) { $youremail = 'myemail@gmail.com'; $fromsubject = 'subject email'; $chocolate = $_POST['chocolate']; $cookies = $_POST['cookies']; $to = $youremail; $mailsubject = ''.$fromsubject.' actionpage'; $body = $fromsubject.' Cookies: '.$cookies.' ?> The idea is that I will receive an e-mail that will tell me whether a box was checked or not and I am not sure how to make it work exactly. any help would be really awesome! William
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.