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 932 results

  1. programAngel

    Simplexml

    if I have the following xml:<?xml version="1.0" encoding="utf-8" ?><NewDataSet> <office> <room /> </office> <office> <room></room> </office> </NewDataSet>if I am using simplexml to parse the file, how can I differentiate between the first case and the second?
  2. Hello internet. I would like to start off by saying that W3Schools forum and all you great programmers that respond to these topics is INVALUABLE!!! Thank you so much. Here is my problem... I currently have only one form for my site<form name=tourney action="m m_post_process_4.php" method="post" onSubmit="return checkit()" target="_blank"> When all the requirements have been met (through the checkit function) the form is sent to the PHP file for processing. However, I have two submit buttons and would like each button to process a different function - one for checkit and one for checkit2. This may seem odd because you may say combine the two functions into one function but the problem I am running into is that I cannot seem to get the element ID during a submit action. If I could I would combine the two functions and run comparisons to do all the work. However, the PHP output keeps telling me "Undefined1" for the ID value I am trying to compare. Any thoughts?
  3. CyRus2273

    Need Some With My Php

    Hi guys. I am glad I found this community because I desperately need some help. I am new at PHP so please bare with my ignorance I run a loop for my member section of my site that contains a form login at login.html, checklogin.php and forhandlerservice.php (the actual membersite)The form takes username and password and when the user submits the information it is send to a file called checklogin.php. In here the username and password is checked against my database.If the username and password is correct the user is redirected to forhandlerservice.php, otherwise the user is told that the username or password is wrong.This all works fine. What I want to do is to greet the user after he logs in. The greeting should be something like: Hello John (where the name changes depending on the login of course).As of now, using the code I have, I can only figure out how to register the username and password in my session, which then only allows me to print out one of these two variables.So my question is this:How do I register the remaining content in my database (I currently have: ID, username, password, realname); where the greeting should be associated with the realname.The code I am using now works fine but is limited to only printing out either the username or password. It looks like this:<?phpecho "Velkommen " . $myusername;?> I have attached the code for checklogin.php and the first lines of my forhandlerservice.php (the rest is just the basic site containing a lot of html) I really hope it makes sense as I desperately need this done.Thanks for your time and help Best,CyRus2273 checklogin.php firstlines.rtf
  4. Fmdpa

    Crazy Php/xml Problem

    I am absolutely stumped on this problem. I've been trying to solve it for hours and hours. The problem is that whenever I perform the following code, instead of appending this once like it should: <rating> <value>(1-5)</value> <ip>127.0.0.1</ip> <id>id</id></rating> It appends it 21 times! Every time! I even switched my code to using SimpleXML instead of DOMDocument and it still did it! When I dump the XML code onto the page, it only shows it appended once. I am thoroughly confused. Anyway, here's SermonRatings.php: <?phprequire_once 'global.php';class SermonRating { public function add($rating, $sermon) { $domDoc = new DOMDocument(); $domDoc->formatOutput = true; $doc = $domDoc->load('sermon_ratings.xml'); $root = $domDoc->getElementsByTagName('ratings')->item(0); $rating_node = $domDoc->createElement('rating'); $value = $domDoc->createElement('value'); $value->appendChild($domDoc->createTextNode($rating)); $ip = $domDoc->createElement('ip'); $ip->appendChild($domDoc->createTextNode($_SERVER['REMOTE_ADDR'])); $sermon_id = $domDoc->createElement('id'); $sermon_id->appendChild($domDoc->createTextNode(xmlentities($sermon))); // xmlentities() defined in global.php; it is not the problem because this was happening before I added the function $rating_node->appendChild($value); $rating_node->appendChild($ip); $rating_node->appendChild($sermon_id); $root->appendChild($rating_node); $saved = $domDoc->save('sermon_ratings.xml'); return $saved; } // ...other unrelated methods...} $sr = new SermonRating;echo $sr->add(1, 'sermon.wma'); And here's sermon_ratings.xml: <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE ratings [ <!ELEMENT ratings (rating*)> <!ELEMENT rating (value , ip , id)> <!ELEMENT value (#PCDATA)> <!ELEMENT ip (#PCDATA)> <!ELEMENT id (#PCDATA)>]><ratings> </ratings> After I visit sermonRatings.php and those last two lines of code trigger the method execution and the file is modified and saved, there are 21 child <rating> elements in the file. I'm totally confused.
  5. confused and dazed

    How Do I Get The Value Of A Button Using Php

    I have many buttons (not radio or checkbox but just simple buttons) on my page where the values were populated by an "onclick" command. How do I get PHP to process all that data and list it out.
  6. birbal

    Php Gtk2 Installation

    I am trying to install php-gtk2 in my local server whihc run on xampp. reading from their website it seems php-gtk run beside with php. It dont run with php. Will it create any trouble to run and work with both from the same server? I have not any prior experiance with gtk so i am not sure how will it work. I can experiment with installation but from this moment i dont want to affect php installation which i am already runing. Any advice regarding this and regarding gtk will be appriciated!thanks!
  7. Is it possible to embed a word document into a html? I have web server host locally like http://localhost, I was able to embed .pdf but not knowing how to embed word document. I've try iframe but instead of showing on the web browser, it prompts the web surfer to save or open and that's not the solution I was look for. Can someone point me to the right information? thank you..
  8. cjy8s@yahoo.com

    Use Php For Product Pages On Shopping Website?

    So I am at the part of my website where I need to decide how to display individual products being sold on the website. I want to display the picture, a description, and link it to a paypal account where the individual product can be sold. But I am unsure how to do it. I could do it with HTML easily, but I am wondering if I should use PHP or another programming langauge so I dont have to create 1 page per product, so I dont have to create 50 additional pages. Im thinking that I would have to create a template page using HTML or PHP and then use the programming language to fill in the description and images according to which link (product) they click. How would I do this exactly? I dont have a ton of experience with PHP, am I way over my head? And would PHP would well with PayPal? again, would that be a huge project?
  9. reflex84

    Lightbox Form "thank You" Page

    Hi, I am busy testing out a lightbox form that I'm working on and I've got all to work except the "success" or "thank you" page.Basically I want the user to fill in the online form and when the they are click 'submit', the "thank you" message or page resolves in the same lightbox that the form was in. Go to www.testing123.co.za/test.htm and click on that link you see saying "AJAX SuperBox".The lightbox is opening up an HTML page within in the test.htm page (basically acting like an iFrame?).When I click submit, the page resolves to the success.htm page (which it should) but not in the lightbox frame. I don't want visitors to leave the test.htm page. My headers at the bottom of my process php form shows as: '; $headers = "From: $from\r\nBCC:{$bcc}\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($to, $subject, $sBodyNew, $headers); header('Location: http://www.testing123.co.za/success.htm'); ?> I assume the Location url above needs code added to it so that it works within the lightbox? Or is there an easier way to do this? Thanks guys!
  10. az1987

    Advice Need

    Hey all,I need some advice.I'm currently in my final year at uni, and my final year project looks interesting too me.Anyways in a nut shell i have to connect a radio receiver to a web server. And then allow the client to scan frequencies or choose a frequence on a web page.Also i have to have create a spectrum plot for each frequency strength.I was just wondering is this at all possible with python or is php or RoR better?
  11. absorr

    Creating Html With Html

    i want to make it so that what you put in an HTML forum when sent will add to a separate HTML page with the input from the forum inserted into code. For example, on a forum in typeit.html you type "My Name" into the name text box and "This Is My Message" into the message box. You clock submit and it sends it to the PHP page which sends <b>My Name</b><br><p>This Is My message</p><br> to a separate HTML page called mytxt.htmlNote that was an example and what the names of pages and forums are above are different in reality.I already have a code to simple print the text as it is but i don't know how to make code with PHP.Here is the code that I have so far: in photo_main.html <form action="upload_file.php" method="post"enctype="multipart/form-data"><input type="file" name="file" id="file" /> <br />Title:<INPUT TYPE="text" NAME="fname"><br>Description:<INPUT TYPE="text" NAME="age"><br>Photo Album:<INPUT TYPE="text" NAME="alb"><br><input type="submit" name="submit" value="Submit" /></form> in upload_file.php <?php if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br />"; echo "Type: " . $_FILES["file"]["type"] . "<br />"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />"; echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />"; if (file_exists("images/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "images/" . $_FILES["file"]["name"]); echo "Stored in: " . "images/" . $_FILES["file"]["name"]; $a_str = array($_POST["fname"],$_POST["age"],$_POST["alb"],$_FILES["file"]["name"]); $contents = implode(PHP_EOL, $a_str); $contents .= PHP_EOL . PHP_EOL; file_put_contents("photos.txt", $contents, FILE_APPEND); print("|$contents|"); } }?> I want to make it so that instead of text going to a txt file I want code going to an HTML file so that i don't have to keep manually putting in uploaded photos. I am going to use an iframe to put in the HTML to a page. If there is a better way than an iframe that would be great too. I hope I was not confusing.
  12. Hi guysI am working on something tricky about display an image under the date text inside the cell in jquery calendarI don't mind about the plug-in of Jquery, My question is how we can assign a certain data for a cell date in the calendar assuming I have an array of values from the database and I want to assign each array element for a specific date? any idea?thanks in advance for any help
  13. brandinhall

    Need Help / Possible Tutorial

    Hey guys!I was wondering if someone would be kind enough to help me out. I am not really a programmer or savvy in that type of nature. I know HTML / CSS but really my experience is in the design field. I am using software called osDate.osDate allows you to give your site a title and meta tags from the admin interface, BUT... osDate doesn't support changing your title/meta tags for specific pages, this is a huge problem for me and the SEO of my site! Here's what I need and I'm hoping someone can help me out with. I want to know if someone could write me a quick tutorial or possibly show me how the code would work to do the following: IF we are on page 'page.php' then use 'THIS' as my title site. As an added bonus, I wonder would hard it would be to fetch 'THIS' from.. let's say a text file? or php file where i can define all the titles etc that get pulled into my title/meta tags? (the same theory would be applied in the meta tags/description) if anyone could gimme a hard, I'd greatly appreciate it! Thanks!
  14. GeAndroid

    Php Code Generator, Give Your Opinion

    Hello, I'm about to buy my first PHP code generator, I have already tested up a few, have my own opinion about it but wanted to discuss it a little bit first, anyone here uses/used? what you guys can tell me about it? I still testing then and will post some of my experience about it. Please comment!
  15. Hi there I have mod_rewrite installed on my apache server, I've successfully got some rewrite rules working but one is just not working! I have a search box that produces a url like this: /search/query-here I have a page called search.php which accepts query strings like q=query-here Here is my rewrite rule that works on my site locally: www-mysite.com:8888 RewriteRule ^search/(.*)$ search\.php?q=$1 Although my search.php is being hit/loaded, no query string is being passed to my live version. When I echo $_SERVER['SCRIPT_FILENAME']. "?".$_SERVER["QUERY_STRING"]; out I get: LOCAL: /search.php?q=aa LIVE: /search.php? Any ideas what I can do?
  16. Hi all, I have just started learning PHP. I hit into this wall currently where I have a page(main.php) which stores the session value 'name' of the login personnel.On login to main.php, some sql scripts will run and username and some values will be shown on the page. The page also allows user to input some values and on submit, the value will be send to confirm.php to validate. So on confirm.php, I have this small code if ($tday < $day){ if($tmth <= $mth){ echo "Please select a valid Date!!"; header("Refresh: 3; url=http://localhost/main.php");} else{ $tempDay = cal_days_in_month(0,$mth,$yr); $tempTotal = $tday + ($tempDay-$day); $calDays = $tempTotal + 1; echo "Total Number of Days Taken is ".$calDays; } } This line header("Refresh: 3; url=http://localhost/main.php"); will redirect back to the previous page automatically after 3 seconds.but I find that the session value 'name' is not loaded. anyway i can change it to reload the whole main.php? TIABai
  17. bigjoe11a

    Uploading Files

    When I try and upload a file. That values come back as empty. Any one have any ideas why this is happening. $newfile = $_FILES['file']['tmp_name']; echo 'File Name '. $newfile; // this returns an empty string. Joe
  18. gdust26

    Php Solution Similar To Iframe

    I am brand new to PHP and I've started my first php website! I am really excited and things have been going smoothly as of now. The problem that I am having is I want to create a portfolio page that will be easy to update and add to in the future. I've looked around and found information about iFrames, but I've heard they're not the best practice or a great solution. I want to do it all in PHP if possible, but I guess the idea would be similar to iFrames - when the link is clicked in the left navigation, then it will load that php include on the right. Here's what what's on my portfolio page:- I have a left sidebar navigation (portfolioNav.php).- I have the project file on the right side as an include as well.- I have all the includes (header.php, footer.php, portfolioNav.php, etc) in the main page called portfolio.php. My site:http://ginadust.com/test/portfolio.php Is there a way to link to the different php files in one <a href>? What is the solution? I would really appreciate any help on this, I seem to be at a loss. Thanks in advance!
  19. absorr

    Submitting To Submit

    I want to make it so that when you hit the submit button, the text in the text box is added onto a separate html document. Don't explain how, just give me a code example and some basics on it.
  20. samerhannoun

    Php Java Bridge

    Hi guys,,, I am into something strange and I haven't any idea about how to implement this ###### (PHP Java Bridge). I make some research and then go back here to ask some question if you can help guys! What I would like to know the following: 1. What is the System requirement for that? (Windows and Linux). and small examples test on windows and Linux FinallyThanks in advance for any help Best wishes
  21. assassin87

    Php Search

    Hi everyone, i have created a project in php, its a phonebook. for example i have two name as alex, when i search it brings me just one alex. How can i bring that second alex. Can you check my codes pls. <?php error_reporting("0"); require_once('Connections/baglanti.php'); ?><?phpif (!function_exists("GetSQLValueString")) {function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = ""){ if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue;}}$currentPage = $_SERVER["PHP_SELF"];$maxRows_arama = 10;$pageNum_arama = 0;if (isset($_GET['pageNum_arama'])) { $pageNum_arama = $_GET['pageNum_arama'];}$startRow_arama = $pageNum_arama * $maxRows_arama;$colname_arama = "-1";if (isset($_GET['kelime'])) { $colname_arama = $_GET['kelime'];}mysql_select_db($database_baglanti, $baglanti);$query_arama = sprintf("SELECT * FROM rehber WHERE adi LIKE %s " , GetSQLValueString("%" . $colname_arama . "%", "text"));$query_limit_arama = sprintf("%s LIMIT %d, %d", $query_arama, $startRow_arama, $maxRows_arama);$arama = mysql_query($query_limit_arama, $baglanti) or die(mysql_error());$row_arama = mysql_fetch_assoc($arama);if (isset($_GET['totalRows_arama'])) { $totalRows_arama = $_GET['totalRows_arama'];} else { $all_arama = mysql_query($query_arama); $totalRows_arama = mysql_num_rows($all_arama);}$totalPages_arama = ceil($totalRows_arama/$maxRows_arama)-1;$queryString_arama = "";if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_arama") == false && stristr($param, "totalRows_arama") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_arama = "&" . htmlentities(implode("&", $newParams)); }}$queryString_arama = sprintf("&totalRows_arama=%d%s", $totalRows_arama, $queryString_arama);mysql_free_result($arama);?><form id="form3" name="form3" method="post" action="index.php"> <input type="submit" name="ANASAYFA" id="ANASAYFA" value="ANASAYFA" /></form><p> </p><table border="1" align="center"> <tr> <td>id</td> <td>adi</td> <td>soyadi</td> <td>gsm</td> <td>ev</td> <td>web</td> <td>mail</td> </tr> <?php do { ?> <tr> <td><a href="ayrinti.php?recordID=<?php echo $row_arama['id']; ?>"> <?php echo $row_arama['id']; ?> </a></td> <td><?php echo $row_arama['adi']; ?> </td> <td><?php echo $row_arama['soyadi']; ?> </td> <td><?php echo $row_arama['gsm']; ?> </td> <td><?php echo $row_arama['ev']; ?> </td> <td><?php echo $row_arama['web']; ?> </td> <td><?php echo $row_arama['mail']; ?> </td> </tr> <?php } while ($row_arama = mysql_fetch_assoc($arama)); ?> <?php do { ?> <?php } while ($row_arama = mysql_fetch_assoc($arama)); ?> <?php do { ?> <tr> <td><a href="ayrinti.php?recordID=<?php echo $row_arama['id']; ?>"> <?php echo $row_arama['id']; ?> </a></td> <td><?php echo $row_arama['adi']; ?> </td> <td><?php echo $row_arama['soyadi']; ?> </td> <td><?php echo $row_arama['gsm']; ?> </td> <td><?php echo $row_arama['ev']; ?> </td> <td><?php echo $row_arama['web']; ?> </td> <td><?php echo $row_arama['mail']; ?> </td> </tr> <?php } while ($row_arama = mysql_fetch_assoc($arama)); ?> <?php do { ?> <?php } while ($row_arama = mysql_fetch_assoc($arama)); ?> </table><br><table border="0"> <tr> <td><?php if ($pageNum_arama > 0) { // Show if not first page ?> <a href="<?php printf("%s?pageNum_arama=%d%s", $currentPage, 0, $queryString_arama); ?>">İlk</a> <?php } // Show if not first page ?></td> <td><?php if ($pageNum_arama > 0) { // Show if not first page ?> <a href="<?php printf("%s?pageNum_arama=%d%s", $currentPage, max(0, $pageNum_arama - 1), $queryString_arama); ?>">Önceki</a> <?php } // Show if not first page ?></td> <td><?php if ($pageNum_arama < $totalPages_arama) { // Show if not last page ?> <a href="<?php printf("%s?pageNum_arama=%d%s", $currentPage, min($totalPages_arama, $pageNum_arama + 1), $queryString_arama); ?>">Sonraki</a> <?php } // Show if not last page ?></td> <td><?php if ($pageNum_arama < $totalPages_arama) { // Show if not last page ?> <a href="<?php printf("%s?pageNum_arama=%d%s", $currentPage, $totalPages_arama, $queryString_arama); ?>">Son</a> <?php } // Show if not last page ?></td> </tr></table><p>Kayıtlar <?php echo ($startRow_arama + 1) ?> hedef: <?php echo min($startRow_arama + $maxRows_arama, $totalRows_arama) ?> / <?php echo $totalRows_arama ?></p><p> </p><form id="form1" name="form1" method="post" action="index.php"> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <p> <input type="submit" name="GERİ" id="GERİ" value="GERİ" /> </p> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote></form><p> </p>
  22. hello there w3teachers and friends. I have some question. I believe that I actually have wrote like a several tens of thousand line of script. But, just a few weeks ago, I met some script that changed a bit of my belief. Well, simply let me make turn the question into some example: case 1: <?phpif($foo == "foo"){echo "<span>some statement is running</span>";}?> case 2:<?phpif($foo != "foo"){?><span>theres no running statement</span><?php}?> okay, the example script that has changed my belief is the second case. So, my question is:1. which example do you thing is good for practice 2. I can see that sometimes, the second case is easier, but sometimes may burden since I need to write <?php echo ;?> to instill some php in it. Thanks a lot and give a comment!!
  23. I want to integrate gtalk in my website just like way2sms.com.If anybody seen api then share a link...
  24. Hi, I have WAMP installed as well as IIS. IIS is on port 80, Apache runs on port 8888 via WAMP I want to be able to hit: http://www-mydomain-co-uk:8888 and for it to bring up: http://localhost :8888/mydomain/index.php So far I have taken these steps: httpd.conf: <VirtualHost *:8888>DocumentRoot /www/mydomainServerName www-mydomain-co-uk# Other directives here</VirtualHost> and hosts file: 127.0.0.1 www-mydomain-co-uk When I hit http://www-mydomain-co-uk:8888 I get: Forbidden You don't have permission to access / on this server. So I'm on the right lines but what the ###### is up?
  25. houssam_ballout

    Upload Word Document

    Hello,I had created a form for users to upload their resumes (only word documents & 1 MB allowed as size), then email it after its been successfully uploaded.Any help?Thanks in advance
×