Jump to content

astonishin

Members
  • Posts

    29
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

astonishin's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Will it work like this? $gender = protect($_POST['gender']); <option <?php if($gender == "male") echo "selected"; ?> value="male">Male</option>
  2. i have the code below i want to use the value of the slected one and echo it as $sex so i can insert it into my mysql database how can that be done.
  3. How do i achieve something like this? http://www.tumblr.com/policy/en/content
  4. thanks for the code i added it into my profile index page and it shows the dault image but it doesnt show the actal profile image if its upload. <?php ob_start(); session_start(); $page = "{$users['username']} Profile"; include "../assets/header.php"; include "../assets/includes/connect.php"; ?> <?php $getusers = mysql_query("select * from users where email_verified=1 order by total_earned desc", $c); while ($users = mysql_fetch_array($getusers)) if ($_GET['do'] == $users['username']) { Print " My Profile Link: <a href=\"http://{$configs['siteurl']}/profile/?do={$users['username']}\">http://{$configs['siteurl']}/profile/?do={$users['username']}</a> </div> "; } ?> <?php $profileimage = $users['profileimage']; $imagelocation = "thumbs/$profileimage"; if(file_exists($imagelocation) && $profileimage != NULL ) { $userimage = "$imagelocation"; } else { $userimage = "thumbs/user.jpg"; } $getusers = mysql_query("select * from users where email_verified=1", $c); while ($users = mysql_fetch_array($getusers)) if ($_GET['do'] == $users['username']) { Print " <div style='width:200; float:left; position:absolute; margin-top:50px;' id='content'> <div class='avatar-b'> <img src='{$userimage}' width='60' height='60'> </div> <span style='font-size:16px;color:#1B91E0;float:left;'>{$users['username']}</span> <br><p> <span style='font-size:16px;color:#A6306B;float:left;margin-right:20px;'><a href=\"inbox.php?send={$users['username']}\">Message</a></span></p> </div> <div style='width:650px; float:right; margin-top:-6px;' id='content'> <form id='myform' action='javascript:get(document.getElementById('myform'));' name='form1'> <div></div><div> <textarea style='color:#000000 !important; margin-left:4px; width:642px;height:46px;' id='comment' rows='5' cols='5' name='comment'></textarea></div> <div style='color:#FF0099; margin-left:4px; font-size:11px;' id='status'></div> <br> <input type='image' style='float:right; margin-right:20px;' value='Post Comment' onclick='submitComment('aaronarod',comment.value)' src='../assets/images/postcomment.png' name='Submit'> <br> </form> </div> <br><br><br> <div style='width:650px; float:right; margin-top:-6px;' id='content'> <div class='avatar-b'> <img src='$userimage' width='60' height='60'> </div> <span style='font-size:16px;color:#1B91E0;float:left;'>{$users['username']}</span> <br> <p> Coming Soon!! </p> </div> <br><br><br> "; } ?> <?php include "footer.php"; ?>
  5. this is what i use to upload and store images <? } else if (isset($_GET['subpage']) && $_GET['subpage'] == 'upload') { // Uploading/Resizing Script $url = $_FILES['imagefile']['name']; // Set $url To Equal The Filename For Later Use if ($_FILES['imagefile']['type'] == "image/jpg" || $_FILES['imagefile']['type'] == "image/jpeg" || $_FILES['imagefile']['type'] == "image/pjpeg") { $file_ext = strrchr($_FILES['imagefile']['name'], '.'); // Get The File Extention In The Format Of , For Instance, .jpg, .gif or .php $copy = copy($_FILES['imagefile']['tmp_name'], "$idir" . $_FILES['imagefile']['name']); // Move Image From Temporary Location To Permanent Location if ($copy) { // If The Script Was Able To Copy The Image To It's Permanent Location print 'Image uploaded successfully.<br />'; // Was Able To Successfully Upload Image $simg = imagecreatefromjpeg("$idir" . $url); // Make A New Temporary Image To Create The Thumbanil From $currwidth = imagesx($simg); // Current Image Width $currheight = imagesy($simg); // Current Image Height if ($currheight > $currwidth) { // If Height Is Greater Than Width $zoom = $twidth / $currheight; // Length Ratio For Width $newheight = $theight; // Height Is Equal To Max Height $newwidth = $currwidth * $zoom; // Creates The New Width } else { // Otherwise, Assume Width Is Greater Than Height (Will Produce Same Result If Width Is Equal To Height) $zoom = $twidth / $currwidth; // Length Ratio For Height $newwidth = $twidth; // Width Is Equal To Max Width $newheight = $currheight * $zoom; // Creates The New Height } $dimg = imagecreate($newwidth, $newheight); // Make New Image For Thumbnail imagetruecolortopalette($simg, false, 256); // Create New Color Pallete $palsize = ImageColorsTotal($simg); for ($i = 0; $i < $palsize; $i++) { // Counting Colors In The Image $colors = ImageColorsForIndex($simg, $i); // Number Of Colors Used ImageColorAllocate($dimg, $colors['red'], $colors['green'], $colors['blue']); // Tell The Server What Colors This Image Will Use } imagecopyresized($dimg, $simg, 0, 0, 0, 0, $newwidth, $newheight, $currwidth, $currheight); // Copy Resized Image To The New Image (So We Can Save It) imagejpeg($dimg, "$tdir" . $url); // Saving The Image imagedestroy($simg); // Destroying The Temporary Image imagedestroy($dimg); // Destroying The Other Temporary Image print 'Image thumbnail created successfully.'; // Resize successful mysql_query("update users set `profileimage`='$url' where id={$_SESSION['userid']}", $c); } else { print '<font color="#FF0000">ERROR: Unable to upload image.</font>'; // Error Message If Upload Failed } } else { print '<font color="#FF0000">ERROR: Wrong filetype (has to be a .jpg or .jpeg. Yours is '; // Error Message If Filetype Is Wrong print $file_ext; // Show The Invalid File's Extention print '.</font>'; } } ?>
  6. I use the line below to get my members profile images, what can i do to let it show $defaultimage if the user has no image? <img src='thumbs/{$users['profileimage']}' width='60' height='60'>
  7. i have to use a code like that on the index page in that location to call the meta info how can i do that. I tried the code below but it gives me an error in Dreamweaver. function openPage( $title ) { print "<html>"; // you could also include DOCTYPE declarations here for all your docs. print "<head><title>$title</title>"; print "<link rel=\"stylesheet\" type=\"text/css\" href=\"mystyle.css\">"; print "<script language=\"JavaScript\" src=\"javascript/myjs.js\"></script>"; print "</head>" }
  8. header <?php include("includes/functions.php"); require("includes/connect.php"); require_once($_SERVER['DOCUMENT_ROOT'] . '/assets/includes/geoip.inc'); $gi = geoip_open($_SERVER['DOCUMENT_ROOT'] . '/assets/includes/GeoIP.dat',GEOIP_STANDARD); $ip = $_SERVER['REMOTE_ADDR']; $checkbanned = mysql_query("select * from banned where ip_addr='$ip'", $c); while($reason = mysql_fetch_array($checkbanned)) if (mysql_num_rows($checkbanned) != 0) { header("Location: ?os=banned"); } //Create cookie if visiter visits referral link if($_GET['ref']) { $expire=time()+60*60*24*30; $ref = $_GET['ref']; setcookie('ref', $ref, $time); } ?> <html> <head> <title><?= $configs['sitename'];?> - <?php if(isset($page)) { print $page; } else { print "{$configs['slogan']}"; } ?></title> <meta name="keywords" content="" /> <meta name="description" content="" /> <meta name="robots" content="index,follow" /> <link rel="stylesheet" type="text/css" href="/assets/css/style.css" media="all" /> </head> <body> <div id="wrapper"> <? if ($_GET['ref'] != "") { $ref = strip_tags($_GET['ref']); } ?> <div id="header"> <a href="../?os=home" title="Mucove"><img src="/assets/images/logo.png" alt="Mucove" /></a> </div> <div id="menu"> <? if ($_SESSION['loggedin'] == 1) { include "includes/connect.php"; $signupbutton = ""; $memarea = " <li><a href=\"../?os=user\">Members</a></li>"; $logbutton = " <li><a href=\"../?os=logout\">Logout</a></li>"; $message = ""; if ($_GET['act'] = "changepaypal" && $_GET['paypal'] != "") { $_GET['act'] = strip_tags($_GET['act']); $paypal = $_GET['paypal']; $paypal = str_replace(array( "<", ">" ), array( "<", ">" ), $paypal); mysql_query("update users set `paypal`='$paypal' where id={$_SESSION['userid']}", $c); $message = "<font color=\"red\">Paypal address updated.</font>"; } $getuser = mysql_query("select * from users where id={$_SESSION['userid']}", $c); $ui = mysql_fetch_array($getuser); $ip = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; mysql_query("update users set `userIP`='$ip' where id={$_SESSION['userid']}", $c); if ($ui['banned'] != "") { die("<center><font color=\"red\"><b>Your account has been banned.</b><br>Reason: {$ui['banned']}</font></center>"); } } else { $signupbutton = " <li id=\"$register\"><a href=\"../?os=register\">Register</a></li>"; $logbutton = " <li id=\"$login\"><a href=\"../?os=login\">Login</a></li>"; } ?> <ul> <li class="<?= $home; ?>"><a href="../?os=home">Home</a></li> <li><a href='../?os=offers'>Offers</a></li> <? print "$memarea"; ?> <li><a href='../?os=contact'>Contact</a></li> <li><a href='../forums.php'>Forum</a></li> <div class="right"> <? print "$logbutton"; ?> <? print "$signupbutton"; ?> </div> </ul> </div> <div class="memstats-container"> <? $get_offers = mysql_query("SELECT * FROM `offers` WHERE active=1", $c); $total_offers = mysql_num_rows($get_offers); $get_users = mysql_query("SELECT * FROM `users`", $c); $total_users = mysql_num_rows($get_users); while($user = mysql_fetch_array($get_users)) { $total_money = $total_money + $user['total_earned']; } print " "; if ($_SESSION['loggedin'] == 1) { print " <span style='padding-left:5px;'><a style='color:#d03434' href='../profile/?do={$ui['username']}'><strong>".$ui['username'].":</strong></a></span> <span style='padding-left:5px;color:white'>$".$ui['current_balance']."</span> <span style='padding-left:5px;color:white'><a class='button' style='background-color:#6BC219'>Inbox</a><a style='background-color:#c42f2f' class='button' href='#'>+</a></span> "; } ?> </div> <? if ($_SESSION['loggedin'] == 1 && $ui['email_verified'] != 1) { ?> <center><div class="not-error"> Your email has not been verified.<br>You will not be able to cashout until you do so.</font><br><a href="http://mucove.com/verify.php">Click here to go to the email verification page</a></br></div></center> <? } ?> <div id="content">
  9. below is the code for my index.php there is a small error how can i fix this <?php ob_start(); session_start(); <title>$configs['sitename'] - if(isset($page)) { print $page; } else { print "{$configs['slogan']}"; } </title> include("assets/header.php"); include("assets/action.php"); include("assets/footer.php"); ?>
  10. I use ?os=etc to get to a page those pages doesnt have header included because its included from where the control area for ?os=etc is. My problem is that the title function i have above only works on pages that includer my header file.
  11. It pretty simple to get to to work i use the code below to get the title and it works but only on pages that directly includes the header. <title><?= $configs['sitename'];?> - <?php if(isset($page)) { print $page; } else { print "{$configs['slogan']}"; } ?></title> i use the get function to get to a page and the header isn't included on them in my index.php file i call the header footer and the control panel for the GET which calls the page as ?os=etc
  12. Where am i suppose to include the pagination?
  13. If you did it right, it would work... What about it doesn't work? I feel like i did it right, on my first tries i was getting errors now im not after i worked on it. Do you see any problems?
  14. I tired did everything right and it doesn't work <?php session_start(); $adjacents = 3; $query = "SELECT * FROM `offer_types` WHERE `active` = '1'"; $total_pages = mysql_fetch_array(mysql_query($query)); $total_pages = $total_pages[0]; $limit = 15; $page = $_GET['page']; if($page) { $start = ($page - 1) * $limit; } else { $start = 0; if ($page == 0) $page = 1; $prev = $page - 1; $next = $page + 1; $lastpage = ceil($total_pages/$limit); $lpm1 = $lastpage - 1; $pagination = ""; if($lastpage > 1) { $pagination .= "<div class=\"pagination\">"; if ($page > 1) $pagination.= "<a href=\"?os=offers&type=" . $row['type'] . "&page=$prev\">&#171;prev</a>"; else $pagination.= "<span class=\"disabled\">&#171;prev</span>"; if ($lastpage < 7 + ($adjacents * 2)) { for ($counter = 1; $counter <= $lastpage; $counter++) { if ($counter == $page) $pagination.= "<span class=\"current\"> |".$counter."| </span>"; else $pagination.= "<a href=\"?os=offers&type=" . $row['type'] . "&page=$counter\"> |".$counter."| </a>"; } } elseif($lastpage > 5 + ($adjacents * 2)) { if($page < 1 + ($adjacents * 2)) { for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++) { if ($counter == $page) $pagination.= "<span class=\"current\"> |".$counter."| </span>"; else $pagination.= "<a href=\"?os=offers&type=" . $row['type'] . "&page=$counter\"> |".$counter."| </a>"; } $pagination.= "..."; $pagination.= "<a href=\"?os=offers&type=" . $row['type'] . "&page=$lpm1\"> |".$lpm1."| </a>"; $pagination.= "<a href=\"?os=offers&type=" . $row['type'] . "&page=$lastpage\"> |".$lastpage."| </a>"; } elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2)) { $pagination.= "<a href=\"?os=offers&type=" . $row['type'] . "&page=1\"> |1| </a>"; $pagination.= "<a href=\"?os=offers&type=" . $row['type'] . "&page=2\"> |2| </a>"; $pagination.= "..."; for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++) { if ($counter == $page) $pagination.= "<span class=\"current\"> |".$counter."| </span>"; else $pagination.= "<a href=\"?os=offers&type=" . $row['type'] . "&page=$counter\"> |".$counter."| </a>"; } $pagination.= "..."; $pagination.= "<a href=\"?os=offers&type=" . $row['type'] . "&page=$lpm1\"> |".$lpm1."| </a>"; $pagination.= "<a href=\"?os=offers&type=" . $row['type'] . "&page=$lastpage\"> |".$lastpage."| </a>"; } else { $pagination.= "<a href=\"?os=offers&type=" . $row['type'] . "&page=1\"> |1| </a>"; $pagination.= "<a href=\"?os=offers&type=" . $row['type'] . "&page=2\"> |2| </a>"; $pagination.= "..."; for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++) { if ($counter == $page) $pagination.= "<span class=\"current\"> |".$counter."| </span>"; else $pagination.= "<a href=\"?os=offers&type=" . $row['type'] . "&page=$counter\"> |".$counter."| </a>"; } } } if ($page < $counter - 1) $pagination.= "<a href=\"?os=offers&type=" . $row['type'] . "&page=$next\">next&#187;</a>"; else $pagination.= "<span class=\"disabled\">next&#187;</span>"; $pagination.= "</div>\n"; } } ?>
×
×
  • 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.