Jump to content

Search the Community

Showing results for tags 'PHP'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

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

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 987 results

  1. Hi! I have a code where I populate the drop down list base on one of the columns in my database. It already display but the value of the chosen list did not affect my mysql query. Now I wanted to ask how I can put the value of the list to my mysql query.This is my code: <?php// db connection$db = "mds_reports";[/indent]if($connect = mysql_connect("172.16.8.32", "mds_reports", "password")) $connect = mysql_select_db($db); else die("Unable to connect".mysql_error());$date_from = $_POST['dfrom'];$date_to = $_POST['dto'];?><html><head><title>Cancelled Orders </title></head><body> <h1>Cancelled Orders</h1> <form name="cancelled_orders" method="POST" action="cancelled_orders_index.php"> Date From: <input type="text" name="dfrom" id="dfrom"> To: <input type="text" name="dto" id="dto"><br /><br /> <?php $i = $_POST['name']; $result_query = mysql_query ("SELECT name FROM restaurant_master") or die (mysql_error()); echo "<select name='name' value=''>Restaurant Name</option>"; $i=1; while($nt=mysql_fetch_assoc($result_query)) { echo "<option selected value='$i' > $nt[name] </option>"."<BR>"; $i++; } echo "</select>"; ?> <input name="submit" type="submit" value="Go"> </form> <table> <table border="2" cellpadding="2" cellspacing="1" style='width:100%;'> <tr> <th>Restaurant Code</th> <th>Restaurant Name</th> <th>Order No</th> <th>Order Source</th> <th>Payment Type</th> <th>Net Total</th> <th>Gross Total</th> <th>Reason</th> </tr> <?php if(isset($_POST['submit'])){ echo "Date select from $date_from to $date_to"."</p>"; echo "Restaurant: $i"."</p>"; $sql = "Select restaurant_master.code, restaurant_master.name, mds_orders.OrderNo, mds_orders.OrderSourceText AS 'Order Source', mds_orders.PaymentTypeText AS 'Payment Type', mds_orders.NetTotal, mds_orders.GrossTotal, ReasonMaster.ReasonDescription AS 'Reason' FROM mds_orders INNER JOIN ReasonMaster ON mds_orders.ReasonFKID = ReasonMaster.PKID INNER JOIN restaurant_master ON mds_orders.RestaurantID = restaurant_master.pkid WHERE mds_orders.OrderDate BETWEEN '".$date_from." 00:00:00' AND '".$date_to." 23:59:59' AND mds_orders.RestaurantID LIKE '$i' AND mds_orders.StatusFKID = 3 ORDER BY restaurant_master.code"; echo $sql; $result = mysql_query($sql) or die("Error: ".mysql_error()); $num_rows = mysql_num_rows($result); $i = 0; if (mysql_num_rows($result) >0) { while ($row = mysql_fetch_array($result,MYSQL_ASSOC)){ $csv .= $row['code'].",". $row['name'].",". $row['OrderNo'].",". $row['Order Source'].",". $row['Payment Type'].",". $row['NetTotal'].",". $row['GrossTotal'].",". $row['Reason'].","."<br>"; ?> <tr> <td><?php echo $row['code'];?></td> <td><?php echo $row['name'];?></td> <td><?php echo $row['OrderNo'];?></td> <td><?php echo $row['Order Source'];?></td> <td><?php echo $row['Payment Type'];?></td> <td><?php echo $row['NetTotal'];?></td> <td><?php echo $row['GrossTotal'];?></td> <td><?php echo $row['Reason'];?></td> </tr> <?php }}} ?> </table><br /> <form name="export" method="POST" action="cancelled_orders_export.php"> <input type="hidden" name="cancel_dfrom" id="data" value="<?=$date_from?>"> <input type="hidden" name="cancel_dto" id="data" value="<?=$date_to?>"> <input type="hidden" name="cancel_name" id="data" value="<?=$name;?>"> <input type="submit" name="extract" value="Extract"> </form></body></html> Thanks and best regards.
  2. Hey there,I was wondering how at times Wikipedia displays that banner at the top of every page when they want one to be there. I use php inlcudes for my website but I know thats probably not what there using because sometimes there is no banner. I guess another great example would be how YouTube sometimes haves alerts for new things going on at the top. Any thoughts / how to do this would be great!Thanks,Allen Lawson
  3. Hey there,I was wondering how at times Wikipedia displays that banner at the top of every page when they want one to be there. I use php inlcudes for my website but I know thats probably not what there using because sometimes there is no banner. I guess another great example would be how YouTube sometimes haves alerts for new things going on at the top. Any thoughts / how to do this would be great! Thanks, Allen Lawson
  4. I am trying to display all the values of a drop-down menu's options. The drop down menu uses an onChange event that is as follows: b1.input1.value=b1.select_business[this.selectedIndex].text And when it's selected and the search button is clicked it displays the business info of a company on the page the user is directed to. How can i display the business info for all the selections in the drop down menu? What i've tried, but only displays the actual Name/Text of the business. //$f = file_get_contents('http://****/business_directory_framed.asp'); //$p = file_put_contents('dir_detail_framed_asp.html', $f); $g = file_get_contents('dir_detail_framed_asp.html');$g = str_replace('action="business_detail_framed.asp"','action="http://****/business_detail_framed.asp"',$g);echo $g;# '/<option[^>]+value="(.*)">(.*)/' //$r = preg_match_all('/<option[^>]+value="([^"]*)">([^"]*)/', $g, $matches) ? $matches[1] : '';$o = preg_match('/b1.input1.value=b1.select_business[this.selectedIndex].text/', $g, $matches) ? $matches[1] : '';print_r ($matches);
  5. Hello. I am very stuck at one point in my web-page project, and I hope that anyone of you can help me. In short, I'm trying to achieve an AJAX-like effect in a SVG-document. What I mean is that when the SVG-document (in my example below called SVGPage.php) has finished loading and is just sitting there waiting, I want to use AJAX on the click of an SVG-element (in my example the rectangle) to send a request to an external PHP-file (in my example called UpdateSVGPage.php).This "UpdateSVGPage.php" is building up SVG-code based on information from a database, and it will echo it back to the SVG-document via the same AJAX-request.The newly received SVG-code is deployed to a specific element in the SVG-code (in my example a <g>-element with the id="new_svg_shape"), and the new shape is instantly rendered and view-able on the SVG image.When the user clicks on the specific shape once again, the whole process should be repeated (meaning that a change in the database would create a different SVG-image). I have made an attempt below (which is not working), and I hope that my intentions are understandable. index.php <?phpsession_start();?><!DOCTYPE html><html> <head> </head> <body> <embed src="SVGPage.php" type="image/svg+xml" width="1000px" height="1000px"/> </body> </html> UpdateSVGPage.php <?phpsession_start(); //get the q parameter from URL $q=$_POST["input"]; echo "<rect x=\"1200\" y=\"233\" width=\"80\" height=\"20\" fill=\"blue\" />"; ?> SVGPage.php <?phpsession_start();header('Content-Type: image/svg+xml');print('<?xml version="1.0" standalone="no"?>');?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"> <script type="text/ecmascript" xlink:href="Library.js"/> <script type="application/ecmascript" > <![CDATA[ function ajax_function(){ var xmlhttp; if (window.XMLHttpRequest){ xmlhttp=new XMLHttpRequest(); } xmlhttp.onreadystatechange=function(input){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ document.getElementById("new_svg_shape").firstChild.data=xmlhttp.responseXML; } } xmlhttp.open("POST","UpdateSVGPage.php?q="+input,true); xmlhttp.send(); } ]]> </script> <rect height="100" width="100" fill="blue" onclick="ajax_function()"> </rect> <g id="new_svg_shape" /> </svg> A big thanks to anyone who might help me !
  6. Ok friends: I'm totally stuck, and I desperately need some guidance from you professionals. For the last couple of months I've been working on a web-page project.This is what I've got so far: - I've got a HTML5 page (index.php)- In this HTML5 page, I've got an embedded SVG-file, which is converted to a PHP-file (drawing.php)- It is converted to PHP, because it uses some data in a database to decide what the SVG-image should look like.- In this SVG-file, a PHP-script builds some graphics, and applies some animations to it.- The SVG-file also has a javascript-library attached to it, which I need for zooming and panning the SVG-image. Everything is fine so far, however now starts the problems:I've got some other data in my database, which is supposed to be displayed on the SVG-image only after the user clicks on a specific shape belonging to the SVG-image. The only possible way I could imagine this to work would be to use AJAX, however I have no idea how to use AJAX together with an embedded SVG-file.Googling for days hasn't help me too much either. I would be very grateful to anyone who could provide some help.
  7. Hey everybody, been a long time. I come bearing a question. I'm working on a website for a couple of buddies, and I'm trying to add some ambiguity in the AJAX calls by using Mod_Rewrite. RewriteEngine onRewriteRule ^([A-Z][A-Za-z]+)\\?(.*)?$ /modules.php?mod=$1&$2 At first I thought there was an error in my Regular Expression, so I decided to test it out in Javascript. Say I am trying to request /Data?user_id=1 The Javascript version returns exactly what it should, [Data,user_id=1], but the page redirects to /modules.php?mod=Data. There isn't even the ampersand, anyone have any ideas about why this isn't working? By the way, it works just fine for/DataRedirecting to /modules.php?mod=Data
  8. Hello,I'm using this script right now:mainpage.php <?php$mainpage = 'secret';?><a href="#" id="renamegroups">Rename groups</a><div id='renamegroupsl'></div> <script type="text/javascript">$('#renamegroups').click(function(){ $("#renamegroupsl").load("../information/renamegroups.php"); return false;});</script> renamegroups.php <?phpecho $mainpage;?> The problem is that I get this error:Notice: Undefined variable: mainpage in (...)So how could I include a file with ajax / jquery (because if I include the file this will work and the error won't show up) Thanks!
  9. Hi!, This is my sample part of my program.. $row['name'].",". $row['region'].",". $row['city'].",". $row['area'].",". $row['street'].",". $row['building'].",". $row['totalorders'].",". $row['totalgross'].","."<br>"; that the output is like this...name, region, city, area, street, building, totalorders, totalgross the output that I need is like this.."name","city","area","street","building","totalorders","totalgross", can you help me how can I make this output..?thanks and have a great day ahead!
  10. I am currently creating an e-learning application for my honours project (This will not go live or be distributed for profit) that teaches php to brand new users however there will obviously be experienced users using the application as well and they will try to attack it or bring it down. My code to process the user input for malicious code strings before it is run thru an eval(); is below.If any of the banned words are found it returns false and the user input never gets near an eval() function. If no banned words are found then it returns true and the input (PHP CODE) is run thru an eval(); and the results checked to see if the user input had the desiered effect (e.g. change the value of a local variable inside a function) Any major security issues that anyone can see or advice on making my applicaton more secure is greatly appreciated. P.s. Any feedback used in the application will be 100% referenced to avoid accusations of plagerism. function checkPHP($input){// array of denied words.$deniedWords = array( //PHP tags '<?', '?>', '?', 'PHP', 'script', //Session Variables '$_SESSION', '$_GET', '$_POST', '$_GLOBALS', '$HTTP_POST_VARS', 'GLOBAL', 'SESSION', 'SERVER', 'GET', 'POST', 'COOKIE', 'REQUEST', 'FILE', //Escape chars on session variables '$_', "'_'", "'\$'", "'\_'", '\$', '\_', "$'", "'$", "_'", "'_", '\\', '/', '_', //Commands that parse code as PHP 'INCLUDE', 'REQUIRE', 'EVAL', //Shell commands 'SYSTEM', 'EXEC', '`', 'SHELL', 'passthru', 'popen', 'DROP', //PHP core functions 'magic_quotes', 'base64_decode', 'scandir', 'file_', 'unlink', 'get_defined_functions', 'get_defined_vars', 'get_defined_constants', 'get_loaded_extensions', 'assert_options', 'assert', 'dl', 'extension_loaded', 'gc_collect_cycles', 'gc_disable', 'gc_enable', 'gc_enabled', 'get_cfg_var', 'get_current_user', 'get_defined_constants', 'get_extension_funcs', 'get_include_path', 'get_included_files', 'get_loaded_extensions', 'get_magic_quotes_gpc', 'get_magic_quotes_runtime', 'get_required_files', 'getenv', 'getlastmod', 'getmygid', 'getmyinode', 'getmypid', 'getmyuid', 'getopt', 'getrusage', 'ini_alter', 'ini_get_all', 'ini_get', 'ini_restore', 'ini_set', 'magic_quotes_runtime', 'main', 'memory_get_peak_usage', 'memory_get_usage', 'php_ini_loaded_file', 'php_ini_scanned_files', 'php_logo_guid', 'php_sapi_name', 'php_uname', 'phpcredits', 'phpinfo', 'phpversion', 'putenv', 'restore_include_path', 'set_magic_quotes_runtime', 'set_time_limit', 'sys_get_temp_dir', 'version_compare', 'zend_logo_guid', 'zend_thread_id', 'zend_version', 'REFLECTION', 'apc_', 'apd_', 'error', 'debug_', 'restore_', 'trigger_', 'override_', 'rename_', 'inclued', 'flush', 'ob_', 'output_', 'overload', 'runkit_', 'wincache_', 'xhprof_', 'rewrite', 'file_exists', 'fopen', 'fwrite', 'fclose', 'ctype_alnum', 'realpath', 'is_file', 'chdir', 'mail', 'preg' );$found = "";for($i=0;$i<count($deniedWords);$i++){ $badWordFound = stristr($input, $deniedWords[$i]); if($badWordFound){ $found = $found."Do not use <span class=bold>".$deniedWords[$i]."</span> in you script. <br />"; }}if($found){ echo "For security reasons, some keywords and characters have been banned for use within user input. Currently your code contains banned words and will NOT be executed until these are removed: <br />" . $found; return false;}else{ return true;}}
  11. i Have 3 table with following fields, 1.users table id, name, password, sub category id, email 2. category table categorie name, category id 3.subcategory table sub category name, sub category id, category id my questian is, how to get users details from user table using category id???????? pleae help
  12. I've been working with php for a short time and picked this form up online to use for my contact page. When tested on my server, http://www.d1082919....h/contact2.html the text fields return all of the correct content (email, name, phone, etc.) to me in an email. When I put the site live, http://vitalhabitats.com/contact2.html the text fields all return blank. I still receive the email, but it looks like this: Email:Name:Phone Number:Comments:Newsletter: I cannot understand what the potential issue may be. I know the form works, just not on this server. My php file is attached for review. Any help is greatly appreciated. contactformprocess.php
  13. absorr

    Filter

    Ok so I'm using this API and whenever I use a method, it gives me more than I want. For example, one function gives me: array(3) { ["result"]=> string(7) "success" ["source"]=> string(14) "getPlayerLimit" ["success"]=> int(20)} when all i want is the number at the bottom by intHow do I make it so that it will only show that number?
  14. I have included a SVG-file into the html-page with the embed-tag, like this: index.html <!DOCTYPE html><html><head> <script type="text/javascript" src="jquery-1.7.1.js"/> function AJAX(){ $.post("UpdatePage.php",function (PhpParameter){ $("#SVGfile").html(PhpParameter); });} </head> <body> <div style="height:50px;width:50px;background-color:black;" onclick="AJAX()"/> <embed src="SVGimage.svg" type="image/svg+xml" /></body></html> The SVG-file looks like this: SVGimage.svg <?xml version="1.0" standalone="no"?> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"> <script type="text/ecmascript" xlink:href="Library.js"/> </svg> The Library.js -file contains a nessicary library to zoom and pan my SVGimage.svg document. Library.js uses the XML-DOM. I use jQuery's POST method together with a PHP-file, which retrieve data from the database and parse it back to the html-file. The problem is:I have stored information in a MySQL database telling what the SVG-picture should look like. How can I transfer this information into the embedded SVG-file? Unfortunatly, I can't used <svg> tags directly in the HTML-file, because the Library.js file is written for the XML-DOM. I didn't write it, and I'm not good enough to convert it into using the HTML-DOM. Any help is very welcome! This has turned out to be a huge headache.
  15. I created a script on a php page. The script is activated when user clicks the submit button on a form. I want to write functions on the same php page. How do I do this? MyData.php<?function getData(){$fname = _POST['fname']; $lname = _POST['lname']; //statements that tells it to write the information to file} function showData(){$price = _POST['price']; $qty = _POST['qty']; $total = $price * $qty; echo $total;}?> MyOutputPage.php<html><head><title>Sample Page</title></head><body>//I want to call the showData() function on the MyData.php page.//How do I do this? <form action=" " method="post"><input type="submit" value="Submit"/></form></body></html> Once I do this, how do I call individual functions on the page. Is there a way to add it to my page with the html like you do when linking to an external javascript script? Thank You
  16. Hi, I am just finalizing my first website and need a little advice on creating a form to complete a sale. I want to get customers name address email etc and then link to paypal to finalise payment. What is the best way to do this? I can create the form easily enough but am not too sure about getting the customers details sent to me via email etc. Advice please????? CheersCammy
  17. hi there, i need a little help with my regex.its been a while since i did this and forgot how to do something quite simple.i want to look for a section of the string that starts in a specific way, has something random in the middle, and ends in a secific way. so for example if i was looking for the the bit that starts 4 and ends 6 in 123456789 i would want to get back 456. the bit in the middle can be any characters and any lenght.i thought i could look for "start"+[.]+"end" but this dfoesnt seem to work. wherethe start is <div class="content">the end is </div> my code so far is below: this ones works if i hard code what im looking for ['stuff to replace']: $pattern = '/\<div class\=\"content\"\>stuff to replace\<\/div\>/';$replacement = '<div class=\"content\">this has been updated</div>';$updatedData = preg_replace($pattern, $replacement, $theFileData);the problem is when i start to look for 'anything' between the start and end:$pattern = '/\<div class\=\"content\"\>+[.]+\<\/div\>/';$replacement = '<div class=\"content\">this has been updated</div>';$updatedData = preg_replace($pattern, $replacement, $theFileData); please help.
  18. Mudsaf

    Php Text Show As ?

    So im having this problem with my php, when i get data from my SQL database example of this.gw-32?(f-bb>>&-p9yI@-)bSlj-wVyIW-(it will show it at website like this -load gw-32?(f-bb>>&-p9yI@-)bSlj-wVyIW-( So when it adds it goes like . Text is echoed to table. SQL type = TEXT. This is my charset on the page: <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> Please any fix/help would be nice .
  19. How do I get php to put the contents, and only the contents, of a file being uploaded into an array?
  20. I developped a simple html/php/mysql website. I would like to run it on my customer's server and I don't want to reveal my source code, so I am looking for a way to hide or encrypt it. I came across ionCube and other commercial solutions, but I need something cheaper (free) and less complex. And I also came across "eval gzinflate str_rot13 base64_decode", but it can be decoded easily, because it doesn't use a "secret key". My question is, how can I encrypt my html/php files with a key file that is placed on my own server. So if I remove it, the software on my customer's server' will not work anymore. Is there anything like that? Thanks.
  21. Hello internet. I have been looking around and I'm not sure I have found the method to use to complete this task. Here it is:- I want the user to send three numerical guesses to my database (this is no problem)- I will submit my own three numbers that will be the actual numbers the user will be trying to guess (this is no problem)- I want to send all those rows through a check function and then assign a value for each row based on how well they did guessing the number (this is where I am having an issue)- I would then like to echo back to the user all the guess totals - along with the names - in a table (this will not be a problem) I think I can handle all of this except how to write the function and send all the rows in mysql through that function and then assign a "total" value for each row based on how well then did guessing. Your help is appreciated.
  22. I am working on a website for my work but they will not give me a webserver. So basically I have to run it off a fileshare. This limits me to HTML, Javascript, and CSS formats to get anything done. I need to be able to accept data entered into a form and store it somewhere so it can later be queried for analysis in another website type format. Any suggestions? Somethings to keep in mind also so you know what I'm working with here. - older dell workstations running XP- IE7 is the only browser we are able to use on the work machines- No web server access or ability to pull in data from outside resources since the machines do not have internet access.
  23. Hello internet. I have been sending my site out to people to test out and mess around with and some feedback I am getting is that they are having pop-up blocker issues and even when they temporarily turn the pop-up blockers off they still do not get my echo's that I really need them to get. So - how do I send the echo right to the same webpage that the form is on?
  24. wernerz

    Suggestions

    I would like to create an interactive form that customers may choose their orders via drop down list/image rollover then are able to view the selected product/image in the adjacent div. After the customer selects which items they would like, they hit the email/submit button to send the product details to the company for the order, and also to have the e-mail formatted in plain text. Help would be appreciated by your suggestions on the best way to go about this from the "back-end" perspective. Would it be better to use javascript and php or do you think a flash form with javascript. Time is not a concern on this project.
  25. Hello Friends I have to visit a website which offers you Free Videos on various topics.Some Links I am posting here.AJAXhttp://learnerstv.com/Free-Computers-Video-lectures-ltv322-Page1.htmFundamentals of PHPhttp://learnerstv.com/Free-Computers-Video-lectures-ltv166-Page1.htmBasics of PHPhttp://learnerstv.com/Free-Computers-Video-lectures-ltv427-Page1.htm Regards,Er. Sumit Machra[+91-9414475695][http://brahmansh.in]
×
×
  • Create New...