Jump to content

AwptiK

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Everything posted by AwptiK

  1. You can change the file/directory permissions so that only the server has access to the folder and it's contents. On CPanel i'm pretty sure you can right-click a folder/file and click "Change Permissions".
  2. Add session_start() to the top of login.php.
  3. echo '<OPTION VALUE="'.$artist_firstname.'.$artist_lastname.'">'.$artist_firstname.' '.$artist_lastname.'</option>'; Ex: <option value="BonJovi">Bon Jovi</option>
  4. I'm sorry, it's supposed to be in the <img> tag, not the <a> tag.
  5. FF - Everything looks fine. Chrome, Safari and Opera - The border around the portfolio pic doesn't even show up (the light gray) and there is no mouseover. IE - The border is blue (like a link), no mouseover, the map overlaps and the logo is about halfway down. Add this: style="border-style:none" to your <a> tags to fix the blue border in IE.
  6. You have to use $_POST['name'] not () Also, make sure you have ; on your third $var = $_POST['name']; line.
  7. echo $newStr; Put that at the very bottom of the code, under the $newStr = strRev($newStr); EDIT: Actually, you have to grab the value from the form and use it as the value of $str at the top of the code. I didn't notice the code at the beginning was just an example and you needed more direction. Ex <html> <head><title>Hex</title></head> <body> <form action="hex.php" method="post"> Enter: <input type="text" name="hex" /> <input type="submit" value="Submit" /> </form> </body> </html> and the hex.php <?php $str = $_POST['hex']; $newStr = ""; for($i = 1; $i < strLen($str); $i++) { $newStr .= $str[$i - 1]; if ($i % 2 === 0) $newStr .= " "; } $newStr = strRev($newStr); echo $newStr; ?>
  8. <?php /* subject and email variables */ $emailSubject = 'Client Query!'; $webMaster = 'myemail'; /* Gathering data variables */ $emailField = $_POST['email']; $nameField = $_POST['name']; $p_numberField = $_POST['p_number']; $commentsField = $_POST['comments']; $body = <<<EOD <br><hr><br> Email: $emailField <br> Name: $nameField <br> Phone Number: $p_numberField <br> Comments: $commentsField <br> EOD; $headers = "From: $emailField \r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailSubject, $body, $headers); /* Results rendered as HTML */ $theResults = <<<EOD <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>untitled</title> <style type="text/css"> <!-- body { background-image: url(background%20links.jpg); } .style1 { font-family: "copperplate Gothic Bold"; color: #51473E; font-size: 36px; } --> </style></head> <body> <p class="style1"> </p> <p class="style1"> </p> <p align="center" class="style1">Thank you for contacting us!</p> <p align="center" class="style1"> your email will be answered within 24 hours</p> </body> </html> EOD; echo $theResults; ?> What he meant by the "s was that you put " " around $theResults(in the next to last line in the code), which treats it like a string, not the variable that it is. I edited it in the above code.
  9. Oh really? I think i'll stick with a Ph.D in Computer Science
  10. You could just put exit; in that if() statement too. $sql = "SELECT DATEDIFF (ThinDate, CURDATE()) AS intval FROM `vegeschedule` "; $result = mysql_query($sql); if (!$result) { echo "Could not successfully run query ($sql) from DB: " . mysql_error(); exit; } if (mysql_num_rows($result) == 0) { echo "No rows found, nothing to print so am exiting"; exit; } if ($result <= 0) { echo "N/A"; exit; } while ($row = mysql_fetch_assoc($result)) { echo $row["intval"]."<br />\n"; } Without the exit; it will run the while() loop.
  11. <?php include('dbconnect.php'); // declare and fill variables $join = $_POST['join']; $login = $_POST['Login']; $username=$_POST['username']; $pass=$_POST['pass']; $time = time(); // compare login information to DB information $sql = "SELECT * FROM `members2` WHERE username='$username' AND pass='$pass' "; $query = mysql_query($sql) or die( mysql_error() . "<br />" . $sql ); $count = mysql_num_rows($query); $row = mysql_fetch_array($query); $mid = $row['mid']; if ($count == 1){ $cookie = $mid; $_SESSION['mid'] = $cookie; echo "Please wait...."; ?> <center><a href="account.php">Click here to continue</a> </center> <?php $time2 = strtotime("now"); $sql2 = "UPDATE `stables` SET `login` = $time2 WHERE `user_name` = '$name'"; $query2 = mysql_query($sql2) or die( mysql_error() . "<br />" . $sql2 ); } else { echo "Authentication Failed"; exit; } ?> <?php //<script language="JavaScript"><!-- //setTimeout('Redirect()',550); //function Redirect() //{ location.href = 'http://derbyfever.zorayah.com/';} // -->//<//cript> ?> One thing changes and another starts. That's debugging for you. When you get an error in one line of code, you don't see the other because it doesn't execute yet(most times). So when you fix line X, the errors on line Y show up.
  12. the "mysql_query($query,$con);" with the $con isn't always necessary. It depends on what's contained within your connection.php file. Oh, thanks for that.
  13. your mysql_query($query); should be mysql_query($query,$con); (or whatever $connection you used)
  14. I'm Sean. I'll be 18 in 12 days. In the past 6 years, i've learned: HTML, JavaScript, Java, Visual Basic, C++ and PHP. I plan to have a more-than-basic knowledge of CSS and touch back up on JS, so I can do AJAX. I'm starting college in August, majoring in Computer Science. I'd like to get either a master's degree or even a Ph.D, depending on how everything goes the next few years. I'd like to own my own web design business, even if it's just a side-job. I'm trying to get it started now with my friend and we'll see what happens throughout college. I guess i'll get out of programming and get more into me, lol. I've recently started working out, i'm doing a program called P90X with the same friend from before. I also like playing soccer, nothing serious, just with a group of friends. I drive a 98 Prelude, which in my opinion is a nice car. No girlfriend right now, but there'll be quite a selection once college starts.
  15. That's because 'op' isn't defined yet. You should use if(!isset($_POST['op'])) { //display form } Edit: Just so you know, isset checks to see if it has a value, any value, so !isset means it has no value, or hasn't been set.
  16. mysql_select_db("smrpg"$conn) or die(mysql_error()); should be mysql_select_db("smrpg",$conn) or die(mysql_error());
  17. Do you want it to display all the rows except a specific one on the page load? If you're trying to display all the rows except for a specific one.. you could just put if($row['title'] == "Whatever title of what you don't want displayed") {} else { //all the others and the echos } in your foreach or while loop, which will print the ones you want and skip the row you don't.
  18. mysql_select_db ("rh_Glory",$dbh); That probably won't change anything ^, but it gives me errors sometimes. Add session_start(); to the very top of the membersonly.php. I also moved the header(); up. <?php session_start(); include('dbconnect.php'); //if the person looking at this page is not logged in, they will be taken to the login page if (!isset($_SESSION['mid'])) { header("Location: login.php?expire=yes"); exit; } $mid = $_SESSION['mid']; $sql ="SELECT * FROM `members2` WHERE mid='$mid'"; $query = mysql_query($sql) or die( mysql_error() . "<br />" . $sql ); $row = mysql_fetch_array($query); $username=$row['username']; ?>
  19. If it's a bot, you could use CAPTCHA. If it's one or more people and they're filling the form out properly (proper email@site.com and the other fields), then I don't know how to help that. Someone did suggest blocking international ips.
  20. <?php header('Location: http://'.$server.'/'.$channel.''); ?>
  21. Good call. Maybe I shouldn't assume the original poster wouldn't be able to catch something like that next time.
  22. Do you get an error? If so, what does it say?
×
×
  • 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.