Jump to content

Shockdot

Members
  • Posts

    27
  • Joined

  • Last visited

Everything posted by Shockdot

  1. I changed the PHP code to the below. However, it's saying that $_FILE['file'] is not set.... <?php if(isset($_FILES['file'])) { for($i = 0; $i < count($_FILES['file']['name']); $i++) { echo($_FILES['file']['name'][$i]); echo($_FILES['file']['type'][$i]); echo($_FILES['file']['tmp_name'][$i]); echo($_FILES['file']['error'][$i]); echo($_FILES['file']['size'][$i]); } } else { echo("Not Set"); } ?>
  2. Hey, I'm trying to create a multiple image upload function for my website... However, it keeps saying this... ( ! ) Notice: Undefined index: file in C:\wamp\www\VAF\admin\uploadpic.php on line 3 Call Stack # Time Memory Function Location 1 0.0004 679336 {main}( ) ..\uploadpic.php:0 Here's my code. <?php ob_start(); session_start(); include("Config.php"); if(isset($_SESSION['username'])) { $username = $_SESSION['username']; $permission = $_SESSION['permission']; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link type="text/css" rel="stylesheet" href="CSS/CSS.css" /> <title><?php echo($title); ?></title> </head> <body> <div class="container"> <div class="loginContainer"> <img src="Images/BGTop.jpg" alt="VAF Studio" /> <?php if(isset($username)) { ?> Welcome <?php echo($username); ?>, please select what you would like to do from the list provided below... <ul> <li><a href="<?php echo($addPics); ?>">Add Pictures</a></li> <li><a href="<?php echo($addVids); ?>">Add Videos</a></li> <li><a href="<?php echo($changePrices); ?>">Change Prices</a></li> <li><a href="logout.php">Logout</a></li> </ul> <form action="uploadpic.php" method="post" enctype="multipart/form-data"> <label for="file">Filename: </label> <input type="hidden" name="MAX_FILE_SIZE" value="90000" /> <input type="file" name="file[]" id="file" multiple="true" /> <input type="submit" name="submit" value="Upload" /> </form> <?php } else { ?> <form action="checklogin.php" method="post" class="loginForm"> <label for="username">Username: </label> <input type="text" name="username" id="username" /> <br /> <label for="password">Password: </label> <input type="password" name="password" id="password" /> <br /> <input type="submit" value="Login" class="loginSubmit" name="loginsubmit" id="loginsubmit" /> </form> <?php if(isset($_GET['state'])) { if($_GET['state'] = "invalid") { ?> <div class="clear"></div> <div class="loginError"> Invalid Username or Password. </div> <?php } } } ?> </div> </div> </body> </html> <?php $files = array(); $fdata = $_FILES['file']; if(is_array($fdata['name'])) { for($i = 0; $i < count($fdata['name']); $i++) { $files[] = array( "name" => $fdata['name'][$i], "type" => $fdata['type'][$i], "tmp_name" => $fdata['tmp_name'][$i], "error" => $fdata['error'][$i], "size" => $fdata['size'][$i]); echo($files[$i]); } } else { $files[] = $fdata; } ?> Help would be greatly appreciated!
  3. I'm not sure how I could go about switching testimonials..
  4. So I'm trying to make a testimonial panel for my website that displays 2 testimonials at a time. The testimonials are stored in a MySQL Database. So basically, what I want it to do is this. 1) Somehow identify which 2 testimonials to select first. 2) Display those 2 testimonials for 20 seconds. 3) Select & display the next 2 testimonials for 20 seconds with fadein and fadeout javascript. 4) Infinite repeat of this, displaying all testimonials stored in the database. I'm trying to accomplish this through the use of AJAX, PHP, & JavaScript. Here is my code so far. GetTestimonials.php <?php require_once("Config.php"); require_once("CommonFunctions.php"); mysqlConnect($SQLHost, $SQLUsername, $SQLPassword, $SQLDatabase) or die('Error: ' . mysql_error()); $id1 = $_GET['id1']; $id2 = $_GET['id2']; $query1 = "SELECT description, author FROM testimonials WHERE id = $id1"; $query2 = "SELECT description, author FROM testimonials WHERE id = $id2"; $result1 = mysql_query($query1) or die(mysql_error()); $result2 = mysql_query($query2) or die(mysql_error()); $row1 = mysql_fetch_array($result1); $row2 = mysql_fetch_array($result2); $description1 = $row1['description']; $author1 = $row1['author']; $description2 = $row2['description']; $author2 = $row2['author']; ?> <div class="uniqueTestimonial"> <img src="Images/oQuote.jpg" alt="'" /> <?php echo($description1); ?> <img src="Images/cQuote.jpg" alt="'" /> <br /> <div class="author"> - <?php echo($author1); ?> </div> </div> <div class="uniqueTestimonial"> <img src="Images/oQuote.jpg" alt="'" /> <?php echo($description2); ?> <img src="Images/cQuote.jpg" alt="'" /> <br /> <div class="author"> - <?php echo($author2); ?> </div> </div> <?php mysql_close(); ?> TestimonialsWidget.php <script> function showTestimonial(firstID, secondID) { if (str == "") { document.getElementById("testimonialsBox").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("testimonialsBox").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","GetTestimonials.php?id1=" + firstID + "?id2=" + secondID, true); xmlhttp.send(); } </script> <div class="testimonialsContainer"> <div class="testimonialsTitle"> <h3>Testimonials</h3> </div> <div class="testimonialsBox" id="testimonialsBox"></div> </div> index.php <?php require_once("Config.php"); require_once("CommonFunctions.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title><?php echo($Title); ?> - Home</title> <link href="CSS/CSS.css" type="text/css" rel="stylesheet"> <script src="JS/jquery.js" type="text/javascript"></script> <script> function loopTestimonial() { window.setInterval(showTestimonial(), 5000); } </script> </head> <body onLoad="loopTestimonial()"> <div class="container"> <div class="headerContainer"> <div class="headerContent"></div> </div> <div class="clear"></div> <div class="contentContainer"> <div class="topContent"> <div class="left"> <?php require_once("TestimonialsWidget.php"); ?> </div> <div class="right"></div> </div> </div> </div> </body> </html>
  5. I want to add a few links to the footer of this template, but I have no idea how to decode this... echo eval(stripslashes(base64_decode('DWVjaG8gZXZhbChzdHJpcHNsYXNoZXMoYmFzZTY0X2RlY29kZShcJ0lHVmphRzljSncwZ0lDQWdQQzlrYVhZK0lBMEpDUWtKQ1FrSkNRa0pQ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YWRtSXpVbXhqYkRsellWYzFiRmd6WkhsWldFSjNXbGhLWTBscU5EaGFSMnd5U1VkT2MxbFlUbnBRVm5kcFdtMDVkbVJIVm5sWU1uaHdZbTFXWTBscU5EaE1NbEp3WkdvME9Fd3lVbkJrYWpST1ExRnJTa05XWkd4WmEwNTJXa2RXZVVsRWVHaEpSMmg1V2xkWk9WaERTblJaVjJ4elpFYzRObUpIVm1oaWJWSjVZbmt4Y0dOdE9YVlJSMmgyWkVjeGFHRlhkM1ZaTWpsMFdFTkpLMVJIVm1oaWJWSjVZbmt4U21OdE9YVlFRemxvVUdkclowbERRV2RKUTBGblNVTkJaMGxCTUVwRFVXdEtVRU01YTJGWVdTdEVVV3RLUTFGck9GcEhiREpKUjJ4clVGWjNhVnB0T1haa1IxWjVXRE5LY0ZveWFEQllRMGtyUkZOQlowbERRV2RKUTBGblNVTkJTa05SYXpoYVIyd3lTVWRzYTFCV2QybGlSemx1WWpFNWFHTXpVbmxrVnpGalNXbzBPRXd5VW5Ca2FqUk9RMUZyU2tOVWQzWmFSMnd5VUdjd1NrTlJhMHBRUjFKd1pHbENhbUpIUm5wamVqRmpTVzFPYzFwWFJubFlRMGtyVUVNNWEyRllXU3RFVVd0S1ExUjNkbHBIYkRKUVp6QktRMVIzZGxwSGJESlFhVUZPU1VOQlowbEVkM1phUjJ3eVVHbEJaMGxEUVdkRVVXczRUREpTY0dScU5HZEVWSGQyV2tkc01sQnNkMjVQZHpBOVhDY3BLU2s3RFE9PVwnKSkpOw0='))); Can someone please help me out?
  6. Not necessary. <?php $input = 'this-0_is$%a.test!!,foobar'; $expr = "~^[-a-z0-9_:%$'.,!]+$~i"; var_dump( preg_match($expr, $input) ); ?> outputs int 1 The issue is his test string isn't what he expects it to be. Garbage in = garbage out. Alright so I did a test and this is what happens. Input String: This is a test string $bla bla ! : , ' ? . - _ What $strin makes that into: This is a test string $bla bla ! : , \' ? . - _ But on a site note.... If i were to do Input String: This is $10 What $string makes that into: $This is $10 it doesn't change.... So something is still wrong because it doesn't change the string...
  7. I thought it had something to do with that, but I removed $NewBDescription = stripslashes($NewBDescription); $NewBDescription = mysql_real_escape_string($NewBDescription); and the same thing still happens.
  8. <?php session_start(); require_once("Config.php"); mysql_connect($DBHost, $DBUsername, $DBPassword) or die("Can't connect to MySQL Server..."); mysql_select_db($DBName) or die ("Can't connect to database..."); $BUsername = $_SESSION['ID']; $NewBDescription = $_POST['BDesc']; $NewBDescription = stripslashes($NewBDescription); $NewBDescription = mysql_real_escape_string($NewBDescription); if(characterCheck($NewBDescription) == false) { $_SESSION['DescError'] = "The description you enter contained some invalid characters. You may only use letters, numbers, spaces, %, :, $, !, ., -, _, and ,."; header("location: profile.php?id=$BUsername"); } else { mysql_query("UPDATE $DBAccountsTbl SET description='$NewBDescription' WHERE username='$BUsername'") or die(mysql_error()); header("location: profile.php?id=$BUsername"); } ?> <?php function characterCheck($string) { $result = true; if(!preg_match("~^[-a-z0-9_:%$'.,!]+$~i", $string)) { $result = false; } return $result; } ?> And the output for what you gave me is <pre>Array ( ) </pre>.
  9. When I enter into the field something like, Jesus', or anything containing an apostrophe it returns as if it would return something that is not allowed to be used... Also when I type something like, The price is $10, it will return as it would return something that is not allowed to be used... But only if I put the $ before other characters.
  10. Thanks! Is there anyway to add an ' to that list? When I add it, it doesn't verify properly... "~^[-a-z0-9_:%$'.,!]+$~i"
  11. Can anyone tell me the preg_match argument that will check to make sure a string contains only the following things... [*]Lower/Upper Case Letters [*]Numbers [*]Hyphens [*]Underscores [*]Colons [*]% Signs [*]$ Signs [*]Periods [*]Comas [*]! Marks
  12. My client wants the user to be logged in or they can't like it. I got it working . Simply made another table that logged a username, the business they are liking, and has the 4 categories on it. When the user clicks the like button it adds the info to the table, if its already added it updates the appropriate category field, and if that field is already liked then it does not add an additional like to the business. Thanks guys!
  13. Yah, that's what I wanted. The issue was storing the liked status properly, but I believe that I've resolved the issue.... Currently coding it now, I'll let you guys know haha. Thanks!
  14. I'm creating a website for a client. The website is basically a huge phone book on local business'... I've created a like form system for various categories, such as Customer Service, Cleanliness, quality, and speed of service. The problem I'm having is that users are able to click the like button without restrictions.... Which is bad haha... I'm looking for a way that if a user likes one of the categories, it is logged and he can no longer like that category. Any ideas?
  15. Hello, I made a server statuc checking script that checks the status of a game server. It works fine on my computer, but when I upload it to my web host it stops working. I'm assuming my web host is blocking it in some way. My host is Yahoo Small Businesses. Does anyone know if they block this kind of thing, or if there is a way to unblock it? Perhaps editing the code? Here is my code, if that helps. <?php function GetServerStatus($site, $port) { $status = array("OFFLINE", "ONLINE"); $fp = @fsockopen($site, $port, $errno, $errstr, 2); if(!$fp) { return $status[0]; } else { return $status[1]; } } $Redemption = GetServerStatus("174.142.118.233", 11661); $RedemptionPossible = GetServerStatus("174.142.118.234", 51665); $Tranquility = GetServerStatus("174.142.118.234", 11601); $TranquilityPossible = GetServerStatus("174.142.118.234", 51665); $Nemesis = GetServerStatus("174.142.118.241", 11601); $NemesisPossible = GetServerStatus("174.142.118.241", 64721); $OverallServer = GetServerStatus("174.142.118.237", 11093); $CodServer = GetServerStatus("8.9.6.122", 4230); echo($CodServer . "<br />"); echo("Overall Server: " . $OverallServer . "<br />"); echo("Redemption: " . $Redemption . "<br />"); echo("Tranquility: " . $Tranquility . "<br />"); echo("Nemesis: " . $Nemesis . "<br />"); ?>
  16. Hello everyone, I'm looking for a JQuery Auto Rotation/Slider script. Basically I need it to show 6 logos and then rotate/slide through another 15 logos. Once it reaches the end it should continue. It must auto rotate. These logos are not links, they are just images rotating. If anyone knows of a decent script that does what I described above, please let me know where to download it. Thanks!
  17. Hello, I designed a small, nothing to brag about, website for my uncle. He wants some videos to be able to be viewed on his website. However, I run into a problem. The Videos all start downloading at the same time, so they take forever and also don't display the 3-last ones till the first two are done. Here is the link... http://vafstudio.ca/SampleVideos.html As you can see, it's no where near reasonable... I would like the videos to only start streaming when the user hits play. Any ideas on how I can do that?
  18. Sorry for the double post, but I`m still needing help with this.
  19. It's late and I've been at this for awhile now... Here is my login code. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php require_once("MBLConfig.php"); // username and password sent from form $MBLEmail = $_POST['Email']; $MBLPassword = md5($_POST['Password']); // To protect MySQL injection (more detail about MySQL injection) $MBLEmail = stripslashes($MBLEmail); $MBLPassword = stripslashes($MBLPassword); $MBLEmail = mysql_real_escape_string($MBLEmail); $MBLPassword = mysql_real_escape_string($MBLPassword); $NameSQL = "SELECT * FROM $SQLTableName WHERE MBLEmail='$MBLEmail' and MBLPassword='$MBLPassword'"; $NameResult = mysql_query($NameSQL); $Row = mysql_fetch_array($NameResult); $Query = "SELECT * FROM $SQLTableName WHERE MBLEmail='$MBLEmail' and MBLPassword='$MBLPassword'"; $Result = mysql_query($Query); $Count = mysql_num_rows($Result); if($Count == 1) { session_start(); $_SESSION['MBLFirstName'] = $Row['MBLFirstName']; $_SESSION['MBLPassword'] = 'MBLPassword'; header("location:../"); } else { header("location:../InvalidLogin.php"); } ?> </body> </html> Perhaps one of you can explain exactly how the code you both provided "WHERE NOW() < DATEADD(`DateCreated`, INTERVAL 1 DAY)", can be incorporated...
  20. Maybe I'm missing something... How does SQL know the DATEADD value for that selected section, if the DATEADD value has not been called and stored? Also, how does this determine the value of the account when trying to login?
  21. Date Created is a php code, not sql based, that just finds the month day and year that the account is created. I need to make it find the time, and then have it add 24 hours to that time into another variable. then store both variables.
  22. Here is my code, I'm not sure how the code would help me. Maybe this could help you explain. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Trial Account Signup</title> </head> <body> <?php require_once("../Config.php"); mysql_connect($Host, $SQLUsername, $SQLPassword) or die("We can't connect to the MySQL Server at this time. Please try again later."); mysql_select_db($SQLDataBaseName) or die("We connected to the MySQL Server, but we were unable to connect to the assigned Database. Please try again later."); $GuestEmail = $_POST['GuestEmail']; $FirstName = "Guest"; /////////////////////////////////////////////////////////////////// ///////////////////////Random Username Start/////////////////////// /////////////////////////////////////////////////////////////////// //Random String - Will specify start of starting string. $RandomUsername = "Trial_"; //Random String Length $RandomUsernameLength = 10; //Random String Character Restrictions - Can only have characters listed in the variable. $RandomUsernameRestrictions = "abcdefghijklmnopqrstuvwxyz0123456789"; //While the RandomUsernameLength is greater then 0 run bellow code. while($RandomUsernameLength > 0) { //Selects a random character from the RandomUsernameRestrictions variable and adds it to the RandomUsername variable. $RandomUsername .= substr($RandomUsernameRestrictions,rand(0,strlen($RandomUsernameRestrictions)),1); //Reduces the RandomUsernameLength variable by 1 so that the loop will eventually end. $RandomUsernameLength -= 1; } /////////////////////////////////////////////////////////////////// ///////////////////////Random Password Start/////////////////////// /////////////////////////////////////////////////////////////////// //Random String - Will specify start of starting string. $RandomPassword = ""; //Random String Length $RandomPasswordLength = 10; //Random String Character Restrictions - Can only have characters listed in the variable. $RandomPasswordRestrictions = "abcdefghijklmnopqrstuvwxyz0123456789"; //While the RandomPasswordLength is greater then 0 run bellow code. while($RandomPasswordLength > 0) { //Selects a random character from the RandomPasswordRestrictions variable and adds it to the RandomPassword variable. $RandomPassword .= substr($RandomPasswordRestrictions,rand(0,strlen($RandomPasswordRestrictions)),1); //Reduces the RandomPasswordLength variable by 1 so that the loop will eventually end. $RandomPasswordLength -= 1; } $UserIP = $_SERVER['REMOTE_ADDR']; $AccountType = 2; $DateCreated = date("m/d/y"); $EmailCheck = mysql_query("SELECT Email FROM Accounts WHERE Email = '$GuestEmail'"); $GuestEmailCheck = mysql_query("SELECT Email FROM Accounts WHERE GuestEmail = '$GuestEmail'"); $GuestUsernameCheck = mysql_query("SELECT Email FROM Accounts WHERE Email = '$RandomUsername'"); if (mysql_num_rows($EmailCheck) > 0) { header("Location: ../Trial/TrialFailed.php"); } elseif (mysql_num_rows($GuestEmailCheck) > 0) { header("Location: ../Trial/TrialFailed.php"); } elseif (mysql_num_rows($GuestUsernameCheck) > 0) { header("Location: ../Trial/TrialUsernameFailed.php"); } else { echo($RandomPassword); $RandomDBPassword = md5($RandomPassword); mysql_query("INSERT INTO Accounts (Email, FirstName, GuestEmail, Password, UserIP, AccountType, DateCreated) VALUES ('$RandomUsername', '$FirstName', '$GuestEmail', '$RandomDBPassword', '$UserIP', '$AccountType', '$DateCreated')"); } ?> </body> </html>
×
×
  • 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.