Jump to content

PHPTOM

Members
  • Posts

    84
  • Joined

  • Last visited

Everything posted by PHPTOM

  1. When you mysql_connect did you give it the variable of $con? Or as long as it isn't a persistant connection you could just remove that line.
  2. Hello, I haven't ran your code. However, I quickly saw that you have used single equals sign in your if statement: if(($user_type = "user") && ($is_verified = "1")) { What you should do is use double equals to create an 'is equal to' condition. For example: if($user_type == 'user' && $is_verified == 1) {
  3. Hey, Looking to find a solution to something. I have been experimenting making a template engine for a website I am building. How can I search a variable for all occurrences of {VARIABLE} eg. {Username} {Title} {Content} so I can str_replace them. Thank you
  4. What are your motives for doing this? I don't get what you are trying to achieve by using output buffering. If you want to display the code just put: <html> <body> <center> <br/> <h1>Apartment Reference #: <?php echo $_POST["reference"]; ?><br /></h1> <br/> <?php echo $_POST["application"]; ?>, <?php echo $_POST["deposit"]; ?><br /> <?php echo $_POST["pets"]; ?><br /> <br/> <?php echo $_POST["community"]; ?><br /> <?php echo $_POST["interior"]; ?><br /> <?php echo $_POST["amenities"]; ?><br /> <br/> <?php echo $_POST["contact"]; ?><br /> <a href="<?php echo $_POST['website'] ?>"><?php echo $_POST['website'];?></a><br/> <br/> <br/> <br/> </body> </html> into a blank php file and it will display
  5. <?php ob_start(); ?> <html> <body> <center> <br/> <h1>Apartment Reference #: <?php echo $_POST["reference"]; ?><br /></h1> <br/> <?php echo $_POST["application"]; ?>, <?php echo $_POST["deposit"]; ?><br /> <?php echo $_POST["pets"]; ?><br /> <br/> <?php echo $_POST["community"]; ?><br /> <?php echo $_POST["interior"]; ?><br /> <?php echo $_POST["amenities"]; ?><br /> <br/> <?php echo $_POST["contact"]; ?><br /> <a href="<?php echo $_POST['website'] ?>"><?php echo $_POST['website'];?></a><br/> <br/> <br/> <br/> </body> <?PHP $HtmlCode= ob_get_contents(); ob_end_flush(); ?>
  6. Couple of ideas: Use AJAX to submit the form to include both of them in a get statement Or: As the value put something like value="1&delete" Then you can explode it to form an array Eg: <input name="delete[]" type="checkbox" value="1&delete" /> $array = explode("&", $val); echo $array[0]; //Value echo array[1]; //ID Hope you get the jist
  7. Id is not passed to PHP. It is used client side in JS/CSS.
  8. It will most probably be the server's host name that has been blocked and not the IP
  9. This might not be down to you personally, but the server been blacklisted. Are you on free shared hosting by any chance?
  10. <?PHP function validFileName($text, $extension = 'jpg'){ return ereg_replace("[^A-Za-z0-9\-]", "", str_replace(' ', '-', strtolower(trim($text)))).'.'.$extension; } echo validFileName("CrazyDave's Upload!"); ?>
  11. Well, presuming you are using Apache and virtual hosts for the different websites on your server.. you could just change the ini for your virtual host?
  12. I've thought of that, the problem though is that files can be up to 5GB in size. If I change the php.ini to allow such big files I think all other (internet) 'friends' may abuse it, that's why I started the home server. Well protect the page with some kind of username/password? Even htaccess would suffice if it is a small time thing.
  13. Security reasons. To the other server you could be a malicious hacker. Best way IMO is to do all the logic on server 1 as to whether to upload or not, then use PHP's FTP functions to upload it to server 2.
  14. Please give us the full picture, because so far you have only gave us bits.
  15. phpBB is the most widely used forum with many updates and modifications to use at your leisure. I believe there is an arabic language pack too. However, these aren't the only forum scripts. There are many paid ones such as vBulletin and Invision.
  16. I think you should push towards using CSS3 more with less graphics. You can do perfectly rounded corners divs using it, and shadows for that fact. It looks too amateur currently, like a junior graphics class. Also, the 'my problem' value should be removed when you click on the input box.
  17. Take a look at CakePHP. Have a read on their website.
  18. Where is the $row array coming from? Do you mean $_POST? Why do you have 2 inputs with the same name (hidden and radio)? Also you should have "1" instead of 1 as it is a string. A simpler way would be $answer = ($_POST['electricity'] == "1") ? "YES" : "NO";
  19. So you are wanting the form to be submitted using AJAX so there is no refresh involved? Seems to me you have the line header( "Location: contact.php" ); which is refreshing the page aswell.
  20. To put it bluntly anything using cookies is a security risk. This is just part and parcel of implementing a remember me. The only things I could think of is if the person logs in with the remember me checked: 1) Login with checked 2) Insert into a remember me table with the IP, ID of user, agent, random auth 3) Set a cookie with the random auth 4) check against it all and if it comes back true login to the user ID Only thing I could think of in the early hours of the morning. I do think this is one of the better methods as you can be remembered on different computers.... eg work and home
  21. This code doesn't actually output to the page, so hence the blank page. Personally I would do this, though I haven't checked that it works: function check_artnum ($article_num) { $query = mysql_query("Select * FROM `articles_content` where `num` = '".$article_num."'"); $num_rows = mysql_num_rows($query); return ($num_rows == 0) ? '101' : $article_num; } echo check_artnum($_GET['cid']);
  22. And what does the page actually say when you try to upload a file?
  23. $variable = " blah blah .. . . . index.php?X=".$_GET['x']."..........blah"; To include another variable inside a string just do "stringstringstring".variable."stringstringstring";
  24. http://www.snow-report.us/somename/operations/error_log Displays your server address & username Also no index file in operations. Not a huge hole, but it is one.
×
×
  • 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.