Jump to content

UQ13A

Members
  • Posts

    58
  • Joined

  • Last visited

    Never

Everything posted by UQ13A

  1. Hi, I currently have two websites each with different hosts. www.websiteA.com and www.websiteB.com . WebsiteB's content is hosted on websiteA as a subdomain (www.B.websiteA.com) When you visit websiteB.com it redirects to B.websiteA.com. How would i get google to show search results for websiteB, not www.B.websiteA.com Thank You
  2. Replace: header(”Content-length: $size”); With header("Content-length: $size");
  3. I think swharrell means use the full open and close tags <?php ?>
  4. change $id=$_GET['id_msg']; to $id=$_GET['msg'];
  5. thanks it worked perfectly.
  6. Thanks i'll give it a try
  7. Hi. I have a from with two Drop Down Menu's (Make and Model). If you select a Car Make from the Make list and Select ANY from the Car Model list. i want it to show all the car models for that make. (Sorry if its hard to understand) here is my form code <form action="search.php" method="GET" name="search"><br /> <select name="make" size="1" class="textbox" id="make"> <option selected="selected" value="">Select Manufacturer</option> <option value="HONDA">HONDA</option> <option value="TOYOTA">TOYOTA</option> </select> <br /><br /> <select name="model" size="1" class="textbox" id="model"> <option selected="selected" value="">Select Model</option></select> <option value="ANY">ANY</option> <option value="CIVIC">HONDA CIVIC</option> <option value="JAZZ">HONDA JAZZ</option> <option value="COROLLA">TOYOTA COROLLA</option> <option value="PRIUS">TOYOTA PRIUS</option> <br /> <br /><br /> <select name="price" class="textbox"> <option value="" selected>Max Price</option> <option value="1000">Up to £1,000</option> <option value="2000">Up to £2,000</option> <option value="3000">Up to £3,000</option> <option value="4000">Up to £4,000</option> </select> <br /><br /> <input type="submit" name="Submit" id="Submit" class="button" value="Find Car >>"> <br> </form> here is my php code <?php if(isset($_GET['Submit'])) { if($_GET['make'] == "") { echo "Error! you need to select a Car Manufacturer"; exit; } else { // Create the variables again. $form_make = $_GET['make']; $form_model = $_GET['model']; $make = mysql_real_escape_string($form_make); $model = mysql_real_escape_string($form_model); // IF THE VALUE OF THE THE 2ND DROP DOWN MENU IS ANY THEN I WANT TO IGNORE AND `Model`='$model' $query = ("SELECT * FROM `car` WHERE `Make`='$make' AND `Model`='$model' ORDER BY `Price` ASC"); $result = mysql_query($query); $numResults = mysql_num_rows($result); if ($numResults == 0) { echo "<u><div align=\"center\">Your search for $make $model ($type) returned $numResults results</div></u>"; exit; } else { // data from query, react accordingly echo "<u><div align=\"center\">Your search for $make $model ($type) returned $numResults results</div></u>"; $i=1; while($row = mysql_fetch_array($result)) { $image = $row['image']; $price = $row['Price']; $town = $row['Town']; $mileage = $row['Mileage']; $colour = $row['colour']; $fuel = $row['fuel']; $transmission = $row['transmission']; $comments = $row['Comments']; $owner = $row['owner']; $id = $row['id']; $Left = $row['days_left']; $comments1 = substr($comments ,0,100); $price1 = round($price, 2); $mileage1 = round($mileage, 2); ?> <br /><br /> <?php print "<div style=\"background-color:#FFFFFF;\" class=\"asAdvertContainer\"> <img src=\"$image\" width=\"125\" height=\"125\" border=\"2.5\"/> <span class=\"carText\"><span align=\"right\"><strong>Make $make | Model $model | Price £$price1 | Location $town <br /> Owner $owner</strong></span><br /> <ul> <li><strong>$mileage1 miles</strong> | <strong>$transmission</strong></li> <li><strong>$colour</strong> <strong>| $fuel</strong></li> </ul>Days Remaining $Left</span> <div align=\"center\"> <textarea name=\"textarea\" cols=\"45\" rows=\"5\" readonly=\"readonly\" class=\"comments\" id=\"textarea\">$comments1</textarea> <br /><a href=\"#\" onclick=\"OpenBrWindow('viewcar.php?carid=$id','','width=600,height=630')\">View full description</a> </div> </div> <br />"; $i++; } } } else { echo "Submit button not pressed"; }
  8. Solved it all i need was this if (($ticketOwner == $username) || ($user[user_level]>="2")) { works like a charm thanks for the help
  9. Yes exactly i dont want other people viewing other peoples tickets which contain sensitive information what if i make a seperate action for moderators, like normal users have tickets.php?view=ID for mods i use tickets.php?read=ID and for tickets.php?read i only limit it for user_level >= 2 would that work?
  10. Sorry but you got me confused im new at php, i guess i should have mentioned thatat the begging
  11. I have removed .... `submitter` = '$username' it works but like before all users can view the ticket information :S even if it is not your ticket you can still view it by changing tickets.php?view=(any ticket number here) and thats what i want to stop others doing
  12. Here it is <?php $username = $_SESSION['username']; $id = $_GET['view']; if (isset($_GET['view'])) { $level = "SELECT * FROM `users` WHERE name = '$username'" or die(mysql_error()); $get = mysql_query($level) or die(mysql_error()); $user = mysql_fetch_array($get); $sql = "SELECT * FROM `Replys` WHERE `ticketID` = '$id' AND `submiter` = '$username'"; if ((@mysql_num_rows(@mysql_query($sql)) > 0) || ($user[user_level]>="2")) { $result = mysql_query($sql); print "<a href=\"Support.php\">Return to Support</a><br /><br />"; while($row = mysql_fetch_array($result)) { $ticketID = $row['ticketID']; $problem = $row['message']; $time_replied = $row['time']; $status = $row['status_code']; $by = $row['by']; $submiter = $row['submiter']; if ($status == 1) { $stats = "This ticket is still <font color=\"00FF00\"><strong>Open</strong></font>"; } elseif ($status == 2) { $stats = "This ticket has been <font color=\"FF6600\"><strong>forwarded to the admin</strong></font>"; } elseif ($status == 3) { $stats = "This ticket has been <font color=\"FF0000\"><strong>closed</strong></font>"; } else { $stats = "<font color=\"FF0000\"><strong>Error/Deleted</strong></font>"; } ?> <br /> <table width="550" cellpadding="5" cellspacing="0" bordercolor="#FFFFFF"> <tr> <td width="75" bgcolor="#FFFFFF"><div align="center"><i><a href=../loggedin54782/profile.php?user=<?php echo $by ?> target="_blank"><?php echo $by ?></a></i><br> <img src="Images/support/mod.gif" width="50" height="50"><br> <i><?php echo $time_replied ?></i></div></td> <td width="475" valign="top" bgcolor="#FFFFFF"><div align="left"><font size="2.75" color="black"><?php echo $problem ?><br /> <br /></font><font size="2.75"><?php echo $stats ?> by <?php echo $by; ?></font></div></td> </tr> </table><br /><br /> <?php $i++; } ?> Add reply form below<br /> <form action="" method="post" name="addreply" id="addreply"> <br /> Reply below... Before forwarding to the admin(s) please ask the user for<br /> more information regarding their ticket!<br /> <textarea name="message" id="message" cols="60" rows="5"></textarea> <br /><br /> <input type="submit" name="Close" id="Close" value="Reply + Close" /> <input type="submit" name="Forward" id="Forward" value="Reply + Forward" /> <input type="submit" name="Add-Reply" id="Add-Reply" value="Add Reply" /> </form> <?php } } else { print "This is not your ticket!"; } ?> </body> </html>
  13. Thanks i replaced the query with this. It all works now. Except this; Moderators are only shown the reply box and not the information about the ticket. i have attached to picture's below [attachment deleted by admin]
  14. I'll take a look tomarrow thanks
  15. The user has to be an administrator or the person who created the ticket. You obviously already have some way of distinguishing a moderator from a user. I think you should be able to figure out the logic here, but everyone always wants me to do it for them. (No I wont do it for you, unless you pay me.) Pay you, would a packet of Skittles do i use this if ($user[user_level]>="2") { were 2 is moderators level
  16. Yes but i want moderators and only moderators to look at the tickets and answer them its a help desk/support system
  17. i sort of get what you mean about the permissions
  18. i want to prevent them from viewing other people's tickets
  19. How would i go about doin that?
  20. I use sessions i check if the user is loggedin then they are shown this page i also tried this mysql query, but only the person who submitted it could see <?php $query = ("SELECT * FROM `Replys` WHERE `ticket` = '$id' AND `submitter` = '$username'"); ?>
  21. Hi i have a problem here. What i have is a ticket support system and i am stuck. Well what i want is to stop people from changing the id to view other tickets eg ticket.php?id=7 to ticket.php?id=1 <?php $username = $_SESSION['username']; $id = $_GET['id']; if($_GET['id'] == "$id") { $query = ("SELECT * FROM `Replys` WHERE `ticket` = '$id'"); $result = mysql_query($query); $numResults = mysql_num_rows($result); while($row = mysql_fetch_array($result)) { $ticketID = $row['ticketID']; $problem = $row['message']; $time_replied = $row['time']; $status = $row['status_code']; $by = $row['by']; $submiter = $row['submiter']; if ($status == 1) { $stats = "This ticket is still <font color=00FF00><strong>Open</strong></font>"; } elseif ($status == 2) { $stats = "This ticket has been <font color=FF6600><strong>forwarded to the admin</strong></font>"; } elseif ($status == 3) { $stats = "This ticket has been <font color=FF0000><strong>closed</strong></font>"; } else { $stats = "<font color=FF0000><strong>Error/Deleted</strong></font>"; } ?> <a href="SupportDesk.php">Return to Support</a><br /><br /> <table width="550" cellpadding="5" cellspacing="0" bordercolor="#FFFFFF"> <tr> <td width="75" bgcolor="#FFFFFF"><div align="center"><i><a href=profile.php?user=<?php echo $by ?> target="_blank"><?php echo $by ?></a></i><br> <img src="Images/support/mod.gif" width="50" height="50"><br> <i><?php echo $time_replied ?></i></div></td> <td width="475" valign="top" bgcolor="#FFFFFF"><div align="left"><font size="2.75" color="black"><?php echo $problem ?><br /> <br /></font><font size="2.75"><?php echo $stats ?> by <?php echo $by; ?></font></div></td> </tr> </table> <br /><br /> <?php $i++; } } else { print "This is not your ticket!"; } ?>
  22. Ah ha i found the error fixed it i changed the following line from <?php $sql = 'DELETE FROM `logs` WHERE UNIX_TIMESTAMP(`time`) + 86400 < UNIX_TIMESTAMP()' or die(mysql_error()); ?> to <?php $sql = mysql_query("DELETE FROM `logs` WHERE UNIX_TIMESTAMP(`time`) + 86400 < UNIX_TIMESTAMP()") or die(mysql_error()); ?>
  23. Thanks for that but i can seem to get it to work in php it works in phpmyadmin <?php include("db.php"); $sql = 'DELETE FROM `logs` WHERE UNIX_TIMESTAMP(`time`) + 86400 < UNIX_TIMESTAMP()' or die(mysql_error()); if(($sql)) { echo '<p>Logs Successfully Deleted!</p>'; } else { echo '<p>Error</p>'; } ?> and it doesnt give any errors
×
×
  • 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.