-
Posts
84 -
Joined
-
Last visited
Everything posted by PHPTOM
-
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.
-
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) {
-
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
-
how to save html output code from php script
PHPTOM replied to southfloridarentalz's topic in PHP Coding Help
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 -
how to save html output code from php script
PHPTOM replied to southfloridarentalz's topic in PHP Coding Help
<?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(); ?> -
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
-
Id is not passed to PHP. It is used client side in JS/CSS.
-
php mail() always appearing in spam [gmail hotmail + more]
PHPTOM replied to MSUK1's topic in PHP Coding Help
It will most probably be the server's host name that has been blocked and not the IP -
php mail() always appearing in spam [gmail hotmail + more]
PHPTOM replied to MSUK1's topic in PHP Coding Help
This might not be down to you personally, but the server been blacklisted. Are you on free shared hosting by any chance? -
<?PHP function validFileName($text, $extension = 'jpg'){ return ereg_replace("[^A-Za-z0-9\-]", "", str_replace(' ', '-', strtolower(trim($text)))).'.'.$extension; } echo validFileName("CrazyDave's Upload!"); ?>
-
Can't connect to mysql DB from PHP code on localhost
PHPTOM replied to MiRed's topic in PHP Coding Help
Top of the file -
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?
-
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.
-
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.
-
Please give us the full picture, because so far you have only gave us bits.
-
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.
-
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.
-
Take a look at CakePHP. Have a read on their website.
-
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";
-
PHP form with Captcha - amnyone used this?
PHPTOM replied to pixelchicken's topic in Third Party Scripts
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. -
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
-
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']);
-
Cannot get move_uploaded_file to work properly
PHPTOM replied to timpickens's topic in PHP Coding Help
And what does the page actually say when you try to upload a file? -
how to keep <?php echo $_GET['x']; ?> as some variables?
PHPTOM replied to spaceman12's topic in PHP Coding Help
$variable = " blah blah .. . . . index.php?X=".$_GET['x']."..........blah"; To include another variable inside a string just do "stringstringstring".variable."stringstringstring"; -
Hack my site and tell me my security holes.
PHPTOM replied to condoravenue's topic in Beta Test Your Stuff!
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.