Jump to content

Search the Community

Showing results for tags 'PHP'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








  1. hello w3schools again, i just have a question this time .today i was trying to adding a upload script to my personal website . by following this tutorial: http://www.w3schools.com/php/php_file_upload.asp so here is my question.if im doing the saving part ''with'' the restrictions on it. what is the syntax for uploading a .torrent/.php/.html/ect file... i mean, before a filetype, there is somfthing that needs to be typed, like now, (image) ect...what is the syntax for making the part of a PHP and TORRENT file. thanks in advance.Hoping answers soon.
  2. Identical Comparison Operator: ===It compares the value and the type. I created a cookie and the value I used was 0. I compared it like this "if($_COOKIE['value']===0){ echo 'EQUAL';}". It seems to not be the same. Can anyone explain to me why? Aren't they both like integers?
  3. FeverZebra

    Realtime form

    Hello there. I've been trying to find useful information with google but I'm not sure what I should look for hence I've failed... Is it possible to make a form which gives results right away, without a "submit" button? Say for instance:34*X=Y X is the value you put into the "form inputbox".Y is the result. If I type 10, then klick another box then I want Y to become 340 without having to push a submit/calculate button. Is this possible? At the moment I've a form and a script on the same page. However, I've to push submit to se the results. When I submit the form is reseted. If I can't make a "
  4. Does setcookie work after the script stops? When I make my script print the cookie after I set it, I get a notice saying it is undefined. If I run another script to print the cookies after the script that sets it, it works fine.
  5. <html><!--php_json.php--><head><script src="json2.js"></script><script src="php.js"></script><script>ajax("php_json.json",function(){oJSON = JSON.parse(xmlhttp.responseText);sJSON = JSON.stringify(oJSON);/*put it hereokay*/});// here, the variable sJSON is undefinedajax("php.php?json="+sJSON,function(){ alert(xmlhttp.responseText); });//</script></head><body></body></html> // php.jsfunction ajax(source,func){xmlhttp = (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP") ? new
  6. dalawh

    Writing into a file

    I was wondering if there was any way to set a file to write to beginning? It seems I am only allowed to do one or the other. Is there an alternative to this?
  7. sunziun

    PHP Min Max

    Hello Everyone, right now I am trying to do an small app that can calculate fees based on the price a user has given. Example: $0.01 - $0.99 = $0.09$1 - $5.99 = $0.13$99 or more = $1.34 So far I have this code but I cannot get it to work properly: if($start < 1.00){ echo "<p>" . $ins_fees[0] . $sym . $ins_fees[1] . "</p>"; // FURTHER CALCULATION } if($start == 1.00){ echo "<p>" . $ins_fees[0] . $sym . $ins_fees[2] . "</p>"; // FURTHER CALCULATION } else{ if($start > 1){ echo "<p>" . $ins_fees[0] . $sym . $ins_fees[2] . "</
  8. I would like to use PHP to put a vertical space on a web page. echo "<br \><br \><br \><br \>"; works fine on FireFox but probably breaks several rules in relation to strict xhtml and may not work as well on other browsers. Is there are more standard/correct/robust way of doing this? Thanks,Peter.
  9. Hello there, I have developed this piece of php/html code, for my custom Wordpress theme. <?php get_header(); ?><div class="layout clearfix"> <div id="content"> <?php if (have_posts()) : ?> <div id="loops-wrapper" class="left"> <?php while (have_posts()) : the_post(); ?> <div id="article-<?php the_id(); ?>" class="article clearfix"> <div class="post-others-wrap"> <p class="categories"><?php the_category('<br />'); ?></p> <div class="khmedia-social"> <p class='st_facebook_vcount'
  10. yoyo w3s...a question is needed to be answered... i have lately readed a little on to cakePHP... but i would like to know, if any in here think its better then normal PHP. and if so, then can anyone help me a little here?... because im trying to build up a design in it, so that an another coder from my mentor team online at ''World Wide Web'' ^^', can code the functionality to it... ideas?...and yes, i have downloaded latest version, just how to use it... i have tried to build up the simple blog at their main website, but it was a ###### without equal... that is why im asking here, when i now
  11. I been trying ti figure this out for a few hours now and I can't seem to figure it out. Hopefully, someone will be able to solve my dilemma. The error I get is "Fatal error: Cannot redeclare getDate() in C:\xampp\htdocs\dalawh\date.php on line 4" test.php <?phprequire 'date.php';$data=$last.' | '.$first.' | '.getDate().' | '.$_SERVER['SCRIPT_FILENAME'];echo $data;?> date.php <?phpfunction getDate(){echo date("l, M j, Y g:i:s A T");}?> When I comment out "require 'date.php'", everything works fine, but of course getDate() returns nothing. So I figured it had to do with that li
  12. When I am coding in a php file (.php extension), is it better to reduce the php area to as small as possible (like in the first case) or does it not matter (like the second case)? <html><body><?php//Some php code?></body></html> OR <?php<html><body>//Some php code</body></html>?>
  13. I know that require give an error and include gives warnings when something goes wrong. I assume require is used for something that you want on the page like a navigation bar or something that appears on multiple pages that doesn't change. I am trying to use include to use a function in another php file, but it seems it only works if I use all the functions in that php page. Is there any way to only use some of the functions and not all? Also, the once means it only shows up once, so any repeats will not show up. Does this apply to each page or the whole site altogether?
  14. dalawh


    I am using an if and else statement. it will display the index.php if the cookies are set and it will display the other.php if the cookies are not set. I have been using the header function to redirect. instead of using require/include to display the page. Is there a better way to redirect the pages or is the header the best way?
  15. dalawh


    I was wondering how sessions worked and how similar are they to cookies. Is there a set indexes for sessions or do you define your own? How do sessions look like? Are they like cookies, where each cookie is like a file with a bunch of variables? Where are the sessions stored?
  16. iam faceing problem in installing SquirrelMail in localhost. please help me...
  17. dalawh

    Visitor IP

    I did a few searches and I found that though $_SERVER['REMOTE_ADDR'] gets you the IP of a visistor, it is not always accurate because they could be hiding behind a proxy. I read that it was good to check $_SERVER['REMOTE_ADDR'] and $_SERVER['HTTP_X_FORWARDED_FOR'] to see if they contained value and if they did, it meant that they were behind a proxy, so it was better to use $_SERVER['REMOTE_ADDR'] and $_SERVER['HTTP_X_FORWARDED_FOR'] instead of $_SERVER['REMOTE_ADDR']. Now my question is whether $_SERVER['REMOTE_ADDR'] and $_SERVER['HTTP_X_FORWARDED_FOR'] where the same or not. If not, what is
  18. I installed wamp on my windows machine and when i tried to open localhost on my browser i received the message."you dont have permission to access / on this server." I searched this on the internet and got to know that there is problem with file and folder permissions.I shoulls change it to 644 and 755.But can you help me on how to change the permmissions.
  19. sonu

    PHP Redirect

    Hi,Friends I need small help.I know it is not an big issue for PHP Experts.I need a redirect code like the example below:If user tries to visit www.domain.com/page1.php then it should redirect to home page means index.phpI need to redirect only 1 particular page not all pages.I will insert this code in index.php .Then,if user tries to visit page1.php then it should be redirected to page2.php .But,the code should redirect only if user trying to access page1.Thanks in Advance! Help me Guys.
  20. <form name="form" action="enter.php" method="post"> First Name: <input type="text" name="first" /><br /> Last Name: <input type="text" name="last" /><br /> <input type="checkbox" name="c1" value="1" onclick="showSubmit()" /> <input type="checkbox" name="c1" value="1" onclick="showSubmit()" /> <input type="checkbox" name="c3" value="1" onclick="showSubmit()" /> <!-- SUBMIT BUTTON HERE --> </form> If I only check the 1st and the 3rd checkbox and press the submit button, but in my enter.php, I made it check print out ea
  21. What is the difference between using the directory functions to change the directory and opening file as opposed to just opening the file straight? I am not sure if you can open a file in a different directory by using the directory function or not, so correct me if it is not possible. chdir("info/");$fileName="info.txt";$file=fopen($fileName,"r+"); VS $directory="info/";$fileName="info.txt";$file=fopen($directory.$fileName,"r+"); If we use the first, how do we change back to the previous directory? If both is possible, which is the better method? Outside of opening files, which is bette
  22. dalawh


    I notice that you can check if a cookie is set or retrieve the information if you knew the name, but what happens if the name was dynamic (changing for each person)? Is there no way to retrieve it? Should the name always be dynamic?
  23. dmallia

    content script

    I would like to do a script that includes content from pages according what the user chooses. Example If the users chooses Contact us from the menu I would like to have the index page displayed with the contact us content( www.website.com/index.php?page=contact-us ). I know it is done by GET requests but don't know how to do it or what is it called. Does anyone have a script or a tutorial on how to do it? Or at lest what is it called so I find a tutorial. Thanks before hand.
  24. Could some of you tell me the basic protection that PHP & MySQL website needs. For example new stuff to me was SQL injection. Q: How to prevent website from SQL injection?Q: What other protection websites require than SQL injection protect? I know that the password should be crypted but somehow i think its not enough or is it?
  25. Hello, I am currently trying to take an html form with array entry, then store these array's into $_SESSION. Please help. The code is listed below. This is the form: <form method="post" action="system/processor/ac36e5fbdefed15a4daf3d7008723c87.php"> <p><table cellpadding=5 cellspacing=5 rules=none width="100%"> <tr> <th>Date</th> <th> </th> <th> </th> <th>Start Time</th> <th>End Time</th> </tr> <?php session_start(); $i = 1; while($i <= "$_SESSION[amt_dates]") { echo("<tr>"
  • Create New...