
astonishin
Members-
Posts
29 -
Joined
-
Last visited
Never
Everything posted by astonishin
-
Will it work like this? $gender = protect($_POST['gender']); <option <?php if($gender == "male") echo "selected"; ?> value="male">Male</option>
-
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.
-
How do i achieve something like this? http://www.tumblr.com/policy/en/content
-
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"; ?>
-
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>'; } } ?>
-
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'>
-
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>" }
-
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">
-
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"); ?>
-
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.
-
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
-
Where am i suppose to include the pagination?
-
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?
-
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\">«prev</a>"; else $pagination.= "<span class=\"disabled\">«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»</a>"; else $pagination.= "<span class=\"disabled\">next»</span>"; $pagination.= "</div>\n"; } } ?>
-
How can i add pagination to this <?php session_start(); global $ui,$count; $page = "offers"; include("assets/includes/connect.php"); include("assets/includes/config.php"); if($_SESSION['loggedin'] != 1){ echo "<font color='red'>Sorry, you must be logged in to view this page.</font>"; include("assets/footer.php"); exit(); } echo "<center><div class='header-orange'><a href='?os=completed'>".$ui['username']." Completed Offers</a></div></center>"; echo "<center>Please select an offer category.</center>"; echo "<center>"; $get = mysql_query("SELECT * FROM `offer_types` WHERE `active` = '1'") or die(mysql_error()); if(mysql_num_rows($get) == 0){ echo ""; } else { while($row = mysql_fetch_array($get)){ echo "<div class='memc'><a href='http://www.mucove.com/?os=offers&type=" . $row['id'] . "'>" . $row['type'] . "</a></div> "; } echo "<br /><br />"; if($_GET['type']){ $sql = mysql_query("SELECT * FROM `offers` WHERE `active` = '1' AND `type` = '" . mysql_real_escape_string($_GET['type']) . "'") or die(mysql_error()); } else { $sql = mysql_query("SELECT * FROM `offers` WHERE `active` = '1'") or die(mysql_error()); } if(mysql_num_rows($sql) == 0){ echo "<font color='red'>Sorry, there are no campaigns availble at this time.</font>"; } else { while($row = mysql_fetch_array($sql)){ echo "<div class='offerc'><table width='100%'>"; echo "<tr>"; echo "<td><a href='http://www.mucove.com/?os=track&campaign=" . $row['id'] . "' target='_blank'>" . $row['name'] . "</a><font style='float: right; font-weight: bold;'>$" . $row['reward'] . "</font><br /><font style='size: 12px;'><i>" . $row['info'] . "</i></font></td>"; echo "</tr>"; echo "</table></div><br /><br />"; } } } echo "</center>"; ?>
-
Below is the code for one of my pages if ($_SESSION['loggedin']!='1') { echo "Please <a href='login.php'>Login</a> or <a href='members/regster.php'>Register</a> to view this page.<br> You will be redirected to <a href='members/login.php'>Login</a> page after 3 seconds."; echo "<meta http-equiv=\"refresh\" content=\"3;url=members/register.php\"></center>"; } else { if ($_GET['action']=='complete') { $query = "SELECT * FROM `pending` WHERE offer_id='".mysql_real_escape_string($_GET['oid'])."' AND user_id='".$ui['id']."'"; $result = mysql_query($query) or die(mysql_error()); if (mysql_num_rows($result)>0) { print "<center>You already submited this offer.<br>Please return to <a href='offers.php'>Offers</a> page and submit another offer.</center>"; exit; } else { $date = date("F j, Y, g:i a"); $getoffer = "SELECT * FROM `offers` WHERE id='".mysql_real_escape_string($_GET['oid'])."'"; $result = mysql_query($getoffer) or die(mysql_error()); $offer = mysql_fetch_array($result); $query = "INSERT INTO `pending` VALUES('','".$offer['id']."','".$ui['id']."','".$date."','".$offer['reward']."','1')"; mysql_query($query) or die(mysql_error()); print "<center>Offer moved to pending list. Please allow it up to 3 days to get approved.<br>Complete more <a href='../offers.php'>Offers</a></center>"; exit; } } else { if ($_GET['action']=='list') { print "<table width=\"100%\"> <tr> <td>Name</td> <td>Reward</td> <td>Status</td> </tr>"; $getpend = "SELECT * FROM `pending` WHERE user_id='".$ui['id']."'"; $pend = mysql_query($getpend) or die(mysql_error()); $getcomp = "SELECT * FROM `completed` WHERE user_id='".$ui['id']."'"; $comp = mysql_query($getcomp) or die(mysql_error()); if ((mysql_num_rows($pend)==0) && (mysql_num_rows($comp)==0)) { print"<center>You don't have any pending or denied offers, Please go to <a href='offers.php'>Offers</a> page to submit any offer by your choice and get reward for it.</center>"; } else { if (mysql_num_rows($comp)>0) { while ($completed = mysql_fetch_array($comp)) { $getoffer = "SELECT * FROM offers WHERE id='".$completed['offer_id']."'"; $offer = mysql_query($getoffer) or die(mysql_error()); if (mysql_num_rows($offer)==0) { continue; } else { $offer = mysql_fetch_array($offer); print" <tr> <td>".$offer['name']."</td> <td>".$offer['reward']."</td> <td><font color=green>Completed</font></td> </tr>"; } } } if (mysql_num_rows($pend)>0) { while ($pending = mysql_fetch_array($pend)) { $getoffer = "SELECT * FROM offers WHERE id='".$pending['offer_id']."'"; $offer = mysql_query($getoffer) or die(mysql_error()); if (mysql_num_rows($offer)==0) { continue; } else { $offer = mysql_fetch_array($offer); if ($pending['status']==1) { $status='<font color=red>Pending</font>'; } if ($pending['status']==2) { $status='<font color=#72a3eb>Denied</font>'; } print" <tr> <td>".$offer['name']."</td> <td>".$offer['reward']."</td> <td>".$status."</td> </tr>"; } } } } print "</table>"; print"<br><center>Back to <a href='../?os=home'>offer</a> page.</center>"; exit; } } print "<center>View <a href='?action=list'>Denied, Pending and Completed</a> offer list.<br><br>"; print "<center>Please select offer type.</center>"; $query = "SELECT * FROM `offer_types` WHERE active=1"; $result = mysql_query($query) or die(mysql_error()); print "<center>"; while ( $otypes = mysql_fetch_array($result)) { print" | <a href='offers.php?type=".$otypes['id']."'>".$otypes['type']."</a> | "; } print "</center><br>"; if ($_GET['type']) { $query = "SELECT * FROM `offers` WHERE active=1 AND type='".mysql_real_escape_string($_GET['type'])."' ORDER BY `reward` DESC"; } else { $query = "SELECT * FROM `offers` WHERE active=1 ORDER BY `reward` DESC"; } $result = mysql_query($query) or die(mysql_error()); if (mysql_num_rows($result)==0) { print "<center>No Offers available at the moment, please check other sections for different offer types.</center>"; } else { print "<table width=\"100%\"> <tr> <td>Name</td> <td>Description</td> <td>Countries</td> <td>Reward</td> <td>Action</td> </tr>"; while ( $offer = mysql_fetch_array($result)) { $getcompleted = "SELECT * FROM `completed` WHERE offer_id='".$offer['id']."' AND user_id='".$ui['id']."'"; $completed = mysql_query($getcompleted) or die(mysql_error()); if (mysql_num_rows($completed)>0) { continue; } else { $getpending = "SELECT * FROM `pending` WHERE offer_id='".$offer['id']."' AND user_id='".$ui['id']."'"; $pending = mysql_query($getpending) or die(mysql_error()); if (mysql_num_rows($pending)==0) { $link = "<form method=GET><input type=hidden name=action value=complete><input type=hidden name=oid value='".$offer['id']."'><input type=submit value='Submit'></form>"; } else { $pend=mysql_fetch_array($pending); if ($pend['status']==1) { $link = "<font color=red>Pending</font>"; } if ($pend['status']==2) { $link = "<font color=#72a3eb>Denied</font>"; } } print " <tr> <td><a href='".$offer['url']."' target=_blank>".$offer['name']."</a></td> <td>".$offer['info']."</td> <td>".$offer['country']."</td> <td>".$offer['reward']."</td> <td>".$link."</td> </tr>"; } } } print "</table>"; } ?> when someone press the submit button it goes to ?action=complete&oid=411 how can i make it go to ?os=offers&action=complete&oid=411
-
Just to elaborate some more some of the files are like below. <? switch ($_GET['do']) { case 'passchange2': do_pass_change(); break; default: pass_change(); break; } function pass_change() { global $ui, $c, $userid, $h; print "<center><h4>To change your password, please fill out the information below.<br></h4><form action='?os=changepass?do=passchange2' method='post'> <table><tr><td> Current Password:</td><td><input type='password' name='oldpw' /></td></tr> <tr><td>New Password:</td><td><input type='password' name='newpw' /></td></tr> <tr><td>Confirm:</td><td><input type='password' name='newpw2' /></td></tr> <Tr><td colspan=2 align=center> <input type='submit' class='button' value='Change Your Password' /></form></td></tr></table></center>"; } function do_pass_change() { global $ui, $c, $userid, $h; if (md5($_POST['oldpw']) != $ui['userpass']) { print "The current password you entered was wrong.<br /> <a href='?os=changepass?do=passchange'>> Back</a>"; } else if ($_POST['newpw'] !== $_POST['newpw2']) { print "The new passwords you entered did not match!<br /> <a href='?os=changepass?do=passchange'>> Back</a>"; } else { $_POST['oldpw'] = strip_tags($_POST['oldpw']); $_POST['newpw'] = strip_tags($_POST['newpw']); mysql_query("UPDATE users SET userpass=md5('{$_POST['newpw']}') WHERE id={$_SESSION['userid']}", $c); print "Password changed!<br>The next time you log in you will need to use your new password."; } } ?> So if i use what they told me above and go to http://mucove.com/?os=changepass then try to change the pass it would try to do something like http://mucove.com/?os=changepass?do=passchange2 to change password but that doesn't work it just shows a blank page. Test the website with the username:test and pass:simpletest
-
ahh it doesnt work and what im trying to achieve is some thing like ?os=learn taking members to a how.php page
-
Thanks im about to add that to my site mucove.com can you please tell me out i can implement this with a page that also calls for other actions like i have my offers.php page and when you click the submit button it goes to a blank page calling ?action=completed
-
Can you please start me off?
-
Im working on that page now.
-
can i pay you to implement this for me? I added this to my site and change the urls from pagename.php to ?os=pagename but some parts of the script needs to run an action after pagename.php?action=complete&oid=416 how can i do this with the script?
-
I implemented this on this page and it doesn't work the site is mucove.com also when the index page loads how can i make it go to mucove.com/?os=home <? session_start(); global $ui,$count; $page = "offers"; include "assets/includes/connect.php"; include "assets/includes/config.php"; if ($_SESSION['loggedin']!='1') { echo "Please <a href='login.php'>Login</a> or <a href='../members/register.php'>Register</a> to view this page.<br> You will be redirected to <a href='login.php'>Login</a> page after 3 seconds."; echo "<meta http-equiv=\"refresh\" content=\"3;url=../?os=register\"></center>"; } else { if ($_GET['action']=='complete') { $query = "SELECT * FROM `pending` WHERE offer_id='".mysql_real_escape_string($_GET['oid'])."' AND user_id='".$ui['id']."'"; $result = mysql_query($query) or die(mysql_error()); if (mysql_num_rows($result)>0) { print "<center>You already submited this offer.<br>Please return to <a href='?os=offers'>Offers</a> page and submit another offer.</center>"; exit; } else { $date = date("F j, Y, g:i a"); $getoffer = "SELECT * FROM `offers` WHERE id='".mysql_real_escape_string($_GET['oid'])."'"; $result = mysql_query($getoffer) or die(mysql_error()); $offer = mysql_fetch_array($result); $query = "INSERT INTO `pending` VALUES('','".$offer['id']."','".$ui['id']."','".$date."','".$offer['reward']."','1')"; mysql_query($query) or die(mysql_error()); print "<center>Offer moved to pending list. Please allow it up to 3 days to get approved.<br>Complete more <a href='../?os=offers'>Offers</a></center>"; exit; } } else { if ($_GET['action']=='list') { print "<table width=\"100%\"> <tr> <td>Name</td> <td>Reward</td> <td>Status</td> </tr>"; $getpend = "SELECT * FROM `pending` WHERE user_id='".$ui['id']."'"; $pend = mysql_query($getpend) or die(mysql_error()); $getcomp = "SELECT * FROM `completed` WHERE user_id='".$ui['id']."'"; $comp = mysql_query($getcomp) or die(mysql_error()); if ((mysql_num_rows($pend)==0) && (mysql_num_rows($comp)==0)) { print"<center>You don't have any pending or denied offers, Please go to <a href='?os=offers'>Offers</a> page to submit any offer by your choice and get reward for it.</center>"; } else { if (mysql_num_rows($comp)>0) { while ($completed = mysql_fetch_array($comp)) { $getoffer = "SELECT * FROM offers WHERE id='".$completed['offer_id']."'"; $offer = mysql_query($getoffer) or die(mysql_error()); if (mysql_num_rows($offer)==0) { continue; } else { $offer = mysql_fetch_array($offer); print" <tr> <td>".$offer['name']."</td> <td>".$offer['reward']."</td> <td><font color=green>Completed</font></td> </tr>"; } } } if (mysql_num_rows($pend)>0) { while ($pending = mysql_fetch_array($pend)) { $getoffer = "SELECT * FROM offers WHERE id='".$pending['offer_id']."'"; $offer = mysql_query($getoffer) or die(mysql_error()); if (mysql_num_rows($offer)==0) { continue; } else { $offer = mysql_fetch_array($offer); if ($pending['status']==1) { $status='<font color=red>Pending</font>'; } if ($pending['status']==2) { $status='<font color=#72a3eb>Denied</font>'; } print" <tr> <td>".$offer['name']."</td> <td>".$offer['reward']."</td> <td>".$status."</td> </tr>"; } } } } print "</table>"; print"<br><center>Back to <a href='../?os=offer'>offer</a> page.</center>"; exit; } } print "<center>View <a href='?action=list'>Denied, Pending and Completed</a> offer list.<br><br>"; print "<center>Please select offer type.</center>"; $query = "SELECT * FROM `offer_types` WHERE active=1"; $result = mysql_query($query) or die(mysql_error()); print "<center>"; while ( $otypes = mysql_fetch_array($result)) { print" | <a href='?os=offers?type=".$otypes['id']."'>".$otypes['type']."</a> | "; } print "</center><br>"; if ($_GET['type']) { $query = "SELECT * FROM `offers` WHERE active=1 AND type='".mysql_real_escape_string($_GET['type'])."' ORDER BY `reward` DESC"; } else { $query = "SELECT * FROM `offers` WHERE active=1 ORDER BY `reward` DESC"; } $result = mysql_query($query) or die(mysql_error()); if (mysql_num_rows($result)==0) { print "<center>No Offers available at the moment, please check other sections for different offer types.</center>"; } else { print "<table width=\"100%\"> <tr> <td>Name</td> <td>Description</td> <td>Countries</td> <td>Reward</td> <td>Action</td> </tr>"; while ( $offer = mysql_fetch_array($result)) { $getcompleted = "SELECT * FROM `completed` WHERE offer_id='".$offer['id']."' AND user_id='".$ui['id']."'"; $completed = mysql_query($getcompleted) or die(mysql_error()); if (mysql_num_rows($completed)>0) { continue; } else { $getpending = "SELECT * FROM `pending` WHERE offer_id='".$offer['id']."' AND user_id='".$ui['id']."'"; $pending = mysql_query($getpending) or die(mysql_error()); if (mysql_num_rows($pending)==0) { $link = "<form method=GET><input type=hidden name=action value=complete><input type=hidden name=oid value='".$offer['id']."'><input type=submit value='Submit'></form>"; } else { $pend=mysql_fetch_array($pending); if ($pend['status']==1) { $link = "<font color=red>Pending</font>"; } if ($pend['status']==2) { $link = "<font color=#72a3eb>Denied</font>"; } } print " <tr> <td><a href='".$offer['url']."' target=_blank>".$offer['name']."</a></td> <td>".$offer['info']."</td> <td>".$offer['country']."</td> <td>".$offer['reward']."</td> <td>".$link."</td> </tr>"; } } } print "</table>"; } ?>
-
How can i implement it with whats below? Sorry for double posting $home = ""; $how = ""; $signup = ""; $offers = ""; $friends = ""; $login = ""; $register = ""; if ($page == "home") { $home = "current_page_item"; } else if ($page == "how") { $how = "curren_page_item"; } else if ($page == "signup") { $signup = "current_page_item"; } else if ($page == "offers") { $offers = "current_page_item"; } else if ($page == "friends") { $friends = "current"; } else if ($page == "login") { $login = "current_page_item"; } else if ($page == "register") { $register == "current_page_item"; }