Jump to content

dziewalex

New Members
  • Posts

    2
  • Joined

  • Last visited

dziewalex's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I havnt used php in a long time same with mysql mysqli and pdo are all very new to me and i have a project that is now due tomorrow... ive been trying to get this to work for over a week now and now as the deadline looms im about to throw up my hands and hope theres someone that could help me finish the code. ( i do plan on learning pdo and the new php8, but i do not have that time atm for this project. I currently only have the html portion made of the form, as well as the db tables / fields. I have also made the results page that would display the inputed fields from the form and that works great "when entering the data manually through 'phpmyadmin' what i am missing is the php to update those fields in the database. I am using a CMS so its a little different as i dont need to connect to the data base as im already connected. this is my current code... <?php require_once "maincore.php"; require_once "subheader.php"; if (iMEMBER) { $data = dbarray($result); $result = dbquery("UPDATE ".$db_prefix."users (user_loyalty, user_cavs, user_foot, user_archer, user_reset, user_6, user_8, user_12, user_16, user_18, user_23") $loyalty = isset($_POST['user_loyalty']) ? stripinput(trim($_POST['user_loyalty'])) : ""; $cavs = isset($_POST['user_cavs']) ? stripinput(trim($_POST['user_cavs'])) : ""; $foot = isset($_POST['user_foot']) ? stripinput(trim($_POST['user_foot'])) : ""; $archer = isset($_POST['user_archer']) ? stripinput(trim($_POST['user_archer'])) : ""; //availability match check boxes with table $reset = isset($_POST['user_reset']) ? stripinput(trim($_POST['user_reset'])) : ""; $reset6 = isset($_POST['user_6']) ? stripinput(trim($_POST['user_6'])) : ""; $reset8 = isset($_POST['user_8']) ? stripinput(trim($_POST['user_8'])) : ""; $reset12 = isset($_POST['user_12']) ? stripinput(trim($_POST['user_12'])) : ""; $reset16 = isset($_POST['user_16']) ? stripinput(trim($_POST['user_16'])) : ""; $reset18 = isset($_POST['user_18']) ? stripinput(trim($_POST['user_18'])) : ""; $reset23 = isset($_POST['user_23']) ? stripinput(trim($_POST['user_23'])) : ""; echo "<div class='' align='center'> <h1>Stats for Eden</h1> </div> <form class='' name='test' method='post' action='".FUSION_SELF."' enctype='multipart/form-data'' target='_self'><br> <div class='' align='center'> <label for='availability' class=''>Select Available Times<span class='tooltip' tooltip='Check the times your available for battle'> </span></label>' <ul id='availability'> <li><input name='reset' value='yes' type='checkbox'>Reset</li> <li><input name='6' value='yes' type='checkbox'>+6</li> <li><input name='8' value='yes' type='checkbox'>+8</li> <li><input name='12' value='yes' type='checkbox'>+12</li> <li><input name='16' value='yes' type='checkbox'>+16</li> <li><input name='18' value='yes' type='checkbox'>+18</li> <li><input name='23' value='yes' type='checkbox'>+23</li> </ul> </div> <div class='' align='center'><label for='footmen' class=''>Footmen<span class='tooltip-element' tooltip='highest level footmen'> </span></label> <select class='form' name='footmen' id='footmen' required='required' aria-required='true'> <option disabled='null' selected='null'>-</option> <option value='7' id='footmen'>T7</option> <option value='8' id='footmen'>T8</option> <option value='9' id='footmen'>T9</option> <option value='10' id='footmen'>T10</option> </select> <label for='archers' class=''>Archers<span class='tooltip' tooltip='highest level archers'></span> </label> <select class='form' name='footmen' id='footmen' required='required' aria-required='true'> <option disabled='null' selected='null'>-</option> <option value='7' id='archers'>T7</option> <option value='8' id='archers'>T8</option> <option value='9' id='archers'>T9</option> <option value='10' id='archers'>T10</option> </select> <label for='archers' class=''>Calvary <span class='tooltip-element' tooltip='highest level calvary'></span> </label> <select class='form' name='calvary' id='calvary' required='required' aria-required='true'> <option disabled='null' selected='null'>-</option> <option value='7' id='calvary'>T7</option> <option value='8' id='calvary'>T8</option> <option value='9' id='calvary'>T9</option> <option value='10' id='calvary'>T10</option> </select> </div> <div class='' align='center'><br> </div> <div class='' align='center'> <label for='loyalty' class=''>Loyalty Level <span class='tooltip' tooltip='EDEN Loyalty'> </span></label> <input placeholder='0' class='form' name='loyalty' value='0' id='number-loyalty' title='eden loyalty level' required='required' form='stat_update' min='0' max='30000' type='number'> </div> <div class='' align='center'> <input name='submit' form='test' formaction='submit-form-db' formmethod='post' formtarget='_self' type='submit'> <input name='reset' type='reset'> </div> </form>"; } else { redirect("index.php"); } require_once "footer.php" ?>
  2. I am currently stuck on getting vidfetch to work with my current website. I am trying to make the code work with my current website. This is how far i got and i do not know what is wrong with it. the java appelt loads up but thats even before i click download it whould load up once i have hit download then it would generate the links for me. but it dosnt do that it loads the java applet uses credit on vidfetch and nothing else. Here is the code i modifed to "work" with my site. <?php require_once "maincore.php";require_once THEMES."templates/header.php"; $url = $_POST['url']; $siteURL = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/'; $bookmarklet = 'javascript:document.location.href=\'' . $siteURL . '?url=\'+escape(document.location.href)'; function getApplet($jarFile, $className, $params = array(), $width=1, $height=1, $name='japplet') { $retVal = ""; $useApplet = 0; $user_agent = $_SERVER['HTTP_USER_AGENT']; if (stristr($user_agent, "konqueror") || stristr($user_agent, "macintosh") || stristr($user_agent, "opera")) { $useApplet = 1; $retVal = sprintf('<applet name="%s" id="%s" archive="%s" code="%s" width="%s" height="%s" MAYSCRIPT >', $name, $name, $jarFile, $className, $width, $height); } else { if (strstr($user_agent, "MSIE")) { $retVal = sprintf('<object name="%s" id="%s" classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" style="border-width:0;" codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4_1-windows-i586.cab#version=1,4,1" width= "%s" height= "%s">', $name, $name, $width, $height); } else { $retVal = sprintf('<object name="%s" id="%s" type="application/x-java-applet;version=1.4.1" width= "%s" height= "%s">', $name, $name, $width, $height); } $params['archive'] = $jarFile; $params['code'] = $className; $params['mayscript'] = 'true'; $params['scriptable'] = 'true'; $params['name'] = $name; } foreach ($params as $var => $val) { $retVal .= sprintf('<param name="%s" value="%s">', $var, $val); } $retVal .= 'It appears you do not have Java installed or it is disabled on your system.<br /> Please download it <a href="http://www.java.com/getjava/" class="link" target="_blank">here</a>'; if ($useApplet == 1) { $retVal .= '</applet>'; } else { $retVal .= '</object>'; } return $retVal;} opentable("Download"); echo"$url"; if (!empty($url)) { echo " <script type='text/javascript'> loaderVisible = true; VFResult = ''; VFProxy = ''; VFThumbnail = ''; function vidfetchSearching() { $('#japplet').width(1); $('#japplet').height(1); $('#vidfetchSearching').show(); } function vidfetchAppend(type,name,index,title) { if(loaderVisible) { $('#vidfetchSearching').hide(); $('#vidfetchLinks').show(); loaderVisible = false; } name = name.replace('Download','Download'); // does name have extension else append it if(name.indexOf(type) < 0) { name += '('+type+')'; } var proxyLink = VFProxy+index+'/'+title+'.'+type.toLowerCase(); $('.vtitle').html(title); if(VFThumbnail.length > 0) { $('.vimage img').attr('src',VFThumbnail); $('.vimage').show(); } if(type == 'MP3') { $('#vidfetchLinks ul.audio').append('<li class='type'+type+''><a href=''+proxyLink+''><span>'+name+'</span></a></li>'); } else { $('#vidfetchLinks ul.video').append('<li class='type'+type+''><a href=''+proxyLink+''><span>'+name+'</span></a></li>'); } } function vidfetchDone() { if(!loaderVisible) { // set thumbnail return; } $('#vidfetchSearching').hide(); $('#vidfetchError').show(); } function vidfetchProxy(url) { } function vidfetchError() { $('#vidfetchSearching').hide(); $('#vidfetchError').show(); } </script> <div id='vidfetchSearching' style=':none;'> <center> <img src='assets/loader.gif'> </center> </div> <div id='vidfetchLinks' style='display:none;'> <div class='productHeadingType4'> <div class='vtitle'></div> <div class='vimage' style='diaplay:none;'><img src=''></div> <div class='cfloat1'><div class='cfloat2'> <ul class='audio'></ul> </div></div> <div class='clear'></div> <div class='previewWarning'>When downloading please do not close/exit this page.</div> </div> </div> <div id='vidfetchLoader'> <center>"; echo getApplet('http://vidfetch.com/java/VidFetchApplet.signed.jar', 'VidFetchApplet.class', array('url' => $url, 'userAgent' => $_SERVER['HTTP_USER_AGENT']), 100, 100); echo " </center> </div> Please make sure you selected yes when prompted for '<b>Always trust content from the publisher</b>'.</span> </div>";} echo " <form action='' method='GET' name='download' id='download'> <input type='text' name='url' value='$url'> <a href='#' onclick='document.forms['download'].submit();'> <span>Download Now</span> </a> </form> <div id='java-required'> Please make sure you have java installed.Select Allow when prompted. </div> </div> </div> </div>"; closetable(); require_once THEMES."templates/footer.php";?> Here is the Original Code - <?php/* * ***************************************************************************** * * ****************************************************************************** * Website: http://www.vidfetch.com * * Copyright: (c) 20011 - Baseapp Systems * * ****************************************************************************** * VERION HISTORY: * * v0.4 [15.3.2011] - Rewrite for VidFetch * v0.3 [22.3.2010] - Rewrite * v0.2 [5.3.2010] - Added Exception Handling * v0.1 [15.11.2009] - Initial Version * * ****************************************************************************** * DESCRIPTION: * * NOTE: See www.vidfetch.com for the most recent version of this script * and its usage. * * ****************************************************************************** */ $siteURL = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/'; $bookmarklet = 'javascript:document.location.href=\'' . $siteURL . '?url=\'+escape(document.location.href)'; function getApplet($jarFile, $className, $params = array(), $width=1, $height=1, $name='japplet') { $retVal = ""; $useApplet = 0; $user_agent = $_SERVER['HTTP_USER_AGENT']; if (stristr($user_agent, "konqueror") || stristr($user_agent, "macintosh") || stristr($user_agent, "opera")) { $useApplet = 1; $retVal = sprintf('<applet name="%s" id="%s" archive="%s" code="%s" width="%s" height="%s" MAYSCRIPT >', $name, $name, $jarFile, $className, $width, $height); } else { if (strstr($user_agent, "MSIE")) { $retVal = sprintf('<object name="%s" id="%s" classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" style="border-width:0;" codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4_1-windows-i586.cab#version=1,4,1" width= "%s" height= "%s">', $name, $name, $width, $height); } else { $retVal = sprintf('<object name="%s" id="%s" type="application/x-java-applet;version=1.4.1" width= "%s" height= "%s">', $name, $name, $width, $height); } $params['archive'] = $jarFile; $params['code'] = $className; $params['mayscript'] = 'true'; $params['scriptable'] = 'true'; $params['name'] = $name; } foreach ($params as $var => $val) { $retVal .= sprintf('<param name="%s" value="%s">', $var, $val); } $retVal .= 'It appears you do not have Java installed or it is disabled on your system.<br /> Please download it <a href="http://www.java.com/getjava/" class="link" target="_blank">here</a>'; if ($useApplet == 1) { $retVal .= '</applet>'; } else { $retVal .= '</object>'; } return $retVal; } if (isset($_GET['url']) && !empty($_GET['url'])) { if (strstr($_GET['url'], 'http')) { $url = $_GET['url']; } else { $error = "Invalid url please enter valid video url."; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Your Site Title</title> <meta name="description" content="Download and Convert videos directly from Youtube, Google, Metacafe and more. Simply copy and paste." /> <meta name="keywords" content="freevid, keep, vid, keep vid, download, direct, help, rip, copy, convert , youtube to mo3 , save, video, stream, youtube, yuotube, toutube, uoutube, houtube" /> <!-- Framework CSS --> <link rel="stylesheet" href="assets/screen.css" type="text/css" media="screen, projection"> <!--[if lt IE 8]><link rel="stylesheet" href="assets/ie.css" type="text/css" media="screen, projection"><![endif]--> <link rel="stylesheet" href="assets/theme.css" type="text/css" media="screen, projection"> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> </head> <body> <div id="header"> <div class="container"> <a href="?"> <div id="logo"> <strong>Your</strong> Site Name </div> </a> <div id="bookmark"> <a href=""> <img src="assets/bookmark.gif" /></a> </div> </div> </div> <div id="content"> <div id="content-upper"> <div id="content-upper-top"> <div class="container"> </div> </div> <div id="content-upper-bottom"> <div class="container"> <h1>Download and Convert Videos Instantly !!!</h1> <p> Just paste the URL of the video in the form below , press the Download button and see the magic happen. For making the process faster use our book marklet next time. </p> <?php if (!empty($url)) { ?> <script type="text/javascript"> loaderVisible = true; VFResult = ""; VFProxy = ""; VFThumbnail = ""; function vidfetchSearching() { $('#japplet').width(1); $('#japplet').height(1); $('#vidfetchSearching').show(); } function vidfetchAppend(type,name,index,title) { if(loaderVisible) { $('#vidfetchSearching').hide(); $('#vidfetchLinks').show(); loaderVisible = false; } name = name.replace("Low Quality","Low Quality"); name = name.replace("Medium Quality","Medium Quality"); name = name.replace("High Quality","High Quality"); // does name have extension else append it if(name.indexOf(type) < 0) { name += "("+type+")"; } var proxyLink = VFProxy+index+"/"+title+"."+type.toLowerCase(); $('.vtitle').html(title); if(VFThumbnail.length > 0) { $('.vimage img').attr('src',VFThumbnail); $('.vimage').show(); } if(type == 'MP3' || type == 'AAC') { $('#vidfetchLinks ul.audio').append('<li class="type'+type+'"><a href="'+proxyLink+'"><span>'+name+'</span></a></li>'); } else { $('#vidfetchLinks ul.video').append('<li class="type'+type+'"><a href="'+proxyLink+'"><span>'+name+'</span></a></li>'); } } function vidfetchDone() { if(!loaderVisible) { // set thumbnail return; } $('#vidfetchSearching').hide(); $('#vidfetchError').show(); } function vidfetchProxy(url) { } function vidfetchError() { $('#vidfetchSearching').hide(); $('#vidfetchError').show(); } </script> <div id="vidfetchSearching" style="display:none;"> <center> <img src="assets/loader.gif"> </center> </div> <div id="vidfetchLinks" style="display:none;"> <div class="productHeadingType4"> <div class="vtitle"></div> <div class="vimage" style="diaplay:none;"><img src=""></div> <div class="cfloat1"><div class="cfloat2"> <ul class="video"></ul> <ul class="audio"></ul> </div></div> <div class="clear"></div> <div class="previewWarning">When downloading please do not close/exit this page.</div> </div> </div> <div id="vidfetchLoader"> <center> <?php echo getApplet('http://vidfetch.com/java/VidFetchApplet.signed.jar', 'VidFetchApplet.class', array('url' => $url, 'userAgent' => $_SERVER['HTTP_USER_AGENT']), 100, 100); ?> </center> </div> <div id="vidfetchError" style="display:none;"> <span style="color: rgb(204, 51, 51);"><b>No Videos found or site not supported.</b><br /> Please make sure you selected yes when prompted for '<b>Always trust content from the publisher</b>'.</span> </div> <?php } ?> <?php if (isset($error) && !empty($error)) { ?> <center><span class="invalidUrl"><?php echo $error; ?> </span></center><br/> <?php } ?> <div id="download-form"> <form action="" method="GET" id="download"> <input type="text" name="url" value="<?= isset($url) ? $url : 'Enter Video URL ...'; ?>" onclick="if(this.value == 'Enter Video URL ...')this.value='';"> <a href="#" onclick="document.forms['download'].submit();"> <span>Download Now</span> </a> </form> </div> <div id="java-required"> Please make sure you have java installed.Select Allow when prompted. </div> </div> </div> </div> <div id="content-lower"> <div class="container"> <ul class="features"> <li> <h3>Lots of Formats </h3> <p>All the popular formats for like FLV , AVI , Mp4 , Mp3 , AAC are supported. </p> <li> <li> <h3>No Waiting !!!</h3> <p>Instantly download and convert videos no waiting , no setups or anything.</p> </li> <li> <h3>Lots of Sites</h3> <p>We support over 100+ sites for Video downloading and are constantly growing.</p> </li> </ul> </div> </div> </div> <div class="fader"> </div> <div id="footer"> <div class="container"> <div id="footer-links"> <!-- Do not remove powered by link if you are a free user of vidfetch --> Powered By <a href="http://vidfetch.com">VidFetch</a> , © Your Site </div> </div> </div> <div class="container"> </div> </body> </html> Thanks
×
×
  • 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.