Jump to content

GingerRobot

Staff Alumni
  • Posts

    4,082
  • Joined

  • Last visited

Everything posted by GingerRobot

  1. Posting multiple times isn't going to help you.
  2. Why would the price of steak go down as people sell? Surely the principle of suppy and demand would suggest that the less steaks there are, the more they are worth (assuming, of course, demand remains constant?) Anyways, aside from that, this can be as simple or as complex as you like. At a basic level, you could 'count up' the amount of steaks available, and base the price on this, making adjustments if certain criteria are met with regard to drug availablity. P.S. I'd love to know what drugs and steak have got to do with each other!
  3. You'll need to specify your own sorting function and use the usort() function.
  4. You set the input box's name such as: name[]
  5. Actually, the whole string is still inside your session variable its an HTML problem. Try: <input type ="text" name ="tstname" value ="<?php echo htmlentities($_SESSION['testname']); ?>"> Note the double quotes. Without surrounding your value in quotes, how is a browser supposed to know when the value ends and the next property begins? Hence why it makes an educated guess, and uses spaces. Also, ive added the htmlentities() function there - otherwse you'll run into issues if your variable contains double quotes.
  6. If you set multiple home pages in IE 7 then they all open when you start IE.
  7. If you set the option followlocation to true, then the data you get back from the other site should be where ever you would normally end up. This would create the appearance of actually being on the other website.
  8. Yeah, you missed out the call to the mysql_fetch_assoc() function. We still need that, we just don't need it in a loop: <?php $con = mysql_connect("localhost","root","administrator"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("test", $con); $result = mysql_query("SELECT details FROM test WHERE first_name = 'scooter'"); $row = mysql_fetch_assoc($result); echo htmlentities($row["details"]); mysql_close($con); ?>
  9. I think missed the point poco - the particular product ID won't be known until the user clicks a particular button. And yes, it'll be javascript to do this. You'll need to set up a function which will change the value of the hidden field depending on which button is pressed.
  10. Tutorials: http://www.phpfreaks.com/tutorials.php You'll find all sorts there And yes, you can do it without a loop. See my last post.
  11. Try: <html> <body> <?php $con = mysql_connect("localhost","root","administrator"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("test", $con); $result = mysql_query("SELECT details FROM test WHERE first_name = 'scooter'"); echo "<table border='1'> <tr> <th>Details</th> </tr>"; echo "</table>"; $row = mysql_fetch_array($result); ?> <input type="text" name="q" size="16" value="<?php echo htmlentities($row["details"]);?>"/> </body> </html> You don't need the while loop if you're only showing one result, so i took that out. And, not knowing whats in your details field, i've used the htmentities() function - otherwise you might have issues if the field contains a double quote, since you are enclosing the value of the field in double quotes. Edit: Beaten to it but posting anyway; we really don't need a loop here
  12. It'll be something like: <?php $query = "SELECT pk, type FROM un_styles"; $result = mysql_query($query) or die(mysql_error()); echo '<select name="type">'; while($row = mysql_fetch_assoc($result)){ echo '<option value="'.$row['type'].'">'.$row['type'].'</option>'; } echo '</select>'; ?>
  13. Using a cron job would be the easiest thing - set a script to run once a week to determine who is 'member of the week' and store that member's id in a database.
  14. Thats quite vague. What are you actually trying to achieve? If you are pulling something from you database (a link to an image say) which is random, but you want it to only change after 5 minutes or so, then you could use sessions: store the time the image was last changed in a session, and if this is greater than 5 minutes, load a new random image and update the time. Of course, this would mean the images are different for different people on your site, but since i don't actually know what you are tying to achieve, that might not be a problem.
  15. [quote author=pocobueno1388 link=topic=119164.msg713284#msg713284 date=1191989021] [quote author=TheFilmGod link=topic=119164.msg675348#msg675348 date=1187573496] Seriously, you don't make good money as a php programmer. 60 grand tops. [/quote] Uhhh....I don't know about anyone else, but I would consider that to be very good money, I would be happy with it :) [/quote] That rather depends on the currency :P
  16. Can you show the code you are actually using?
  17. I assume you mean the value? Im not quite sure why you would want to, but you have two options. You could either set a different cookie variable for each of your checkboxes, or you could serialize the array and store the serialized array as a single variable in your cookie.
  18. Hmm. I know, you could always try looking at line 53. Sure, i missed one of your strings out. But im pretty sure it's not that difficult to work out what you need to do.
  19. You need to place strings inside of quotes: <?php $fop = fopen('secure/settings.mfh', 'r'); $content = fread($fop, '999'); fclose($fop); $content = explode("|", $content); $compname = "NIMISH"; ////Your Company Name $slogan = "YOUTH ARE NOT USELESS BUT ARE USED LESS"; //// Your Company Slogan $scripturl = "upload/config.php"; //// the URL to this script with a trailing slash $adminpass = 'password'; //// set this password to something other than default //// it will be used to access the admin panel $email = 'nimish00678@gmail.com'; //// your eMail-Adress for abuse/support and user registration page $maxfilesize = 1024; //// the maximum file size allowed to be uploaded (in megabytes) $downloadtimelimit = 0; //// time users must wait before downloading another file (in minutes) $uploadtimelimit = 0; //// time users must wait before uploading another file (in minutes) $nolimitsize = 0; //// if a file is under this many megabytes, there is no time limit $deleteafter = 10000; //// delete files if not downloaded after this many days $downloadtimer = 0; //// length of the timer on the download page (in seconds) $language = $content[15]; if ($content[9]=="false") $result9 = false; else $result9 = true; $enable_filelist = true; //// allows users to see a list of uploaded files. set to false to disable if ($content[10]=="false") $result10 = false; else $result10 = true; $shourturl = frendz.110mb.com/upload/files; //// Short url Eg yourdomain.com/13232 needs mod_rewrite enabled. For More Info See Our Froum if ($content[11]=="false") $result11 = false; else $result11 = true; $emailoption = $result11; //// set this to true to allow users to email themselves the download links if ($content[12]=="false") $result12 = false; else $result12 = true; $passwordoption = false; //// set this to true to allow users to password protect their uploads if ($content[13]=="false") $result13 = false; else $result13 = true; $descriptionoption = false; //// set this to true to disable the description field if ($content[14]=="false") $result14 = false; else $result14 = true; $topten = true; //// Make It true if you want to enable Top ten files $perpage = 50; //// if $enable_filelist is true (above), how many files to display per page (recommended default is 50); //$categories = array("Documents","Applications","Audio","Misc"); //// remove the //'s from the above line to enable categories //// Users will be able to choose from this list of categories $allowedtypes = array("txt","gif","jpg","jpeg","jpeg","mp3","sisx","avi","wmv","sis","rar","zip","mp4","exe"); //// remove the //'s from the above line to enable file extention blocking //// only file extentions that are noted in the above array will be allowed $pps1 = true; //// the hits shows on admin's filelist $pps2 = true; //// the hits shows on filelist $pps3 = true; //// the hits shows on admin's filelist $style = 'css/default.css'; //// The Style of your MiniFileHost $your_name = 'NIMISH'; //// Your Name $your_street = 'MUMBAI'; //// Your Street $your_city = 'MUMBAI'; //// Your Name $your_url = 'http://frendz.110mb.com'; //// Your Internet $your_phone = '1234567890'; //// Your Phone-Number $your_aemail = 'nimish00678@gmail.com'; //// Your Abuse-EMail
  20. Well there you go then. The value of the cookie that you store must be a string, not an array. $_POST is an array containing all of the information that has been sent to the page via the post method. What is it that you actually want to store?
  21. So you get an error? What is the error?
  22. Actually, you're going to need to change it around a bit more than that. Try changing welcome.php to: <?php if(isset($_POST['submit']){//lets see if the form has been submitted before we try and use the variables $name = $_POST["name"]; $pass = $_POST["password"]; if ($name == "admin" && $pass == "admin") header('Location: ../welcome.php'); else header('Location: ../log.php'); } ?> <form action="welcome.php" method="post"> User Name: <input type="text" name="name"> Password: <input type="password" name="password"> <input type="submit" value="Login" name="submit"> </form> The reason for the changes: You cannot send a header after output. Therefore, we want to do the direction before the form is displayed. I also added in a check to see if the form has been submitted. Otherwise you would always be redirected, everytime the page loads.
  23. change this: if ($name && $pass == "admin") to: if ($name == "admin" && $pass == "admin")
  24. How about showing us the code you have? There is no reason why you wouldn't be able to set a cookie from post data. Show us what you've done so far, and tell us what happens when you try that code.
  25. Try: var u=<?PHP echo $user; ?> var p=<?PHP echo $pass; ?> You don't need the single quotes. Strings inside single quotes are treated as literals - what you were echoing would be the exact text $user - not the variable's value.
×
×
  • 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.