List Db Contents
can someone help me make a script that will list the information in one colum in my table! See each clan I have has an ID, and CEO and bla bla bla! But what I want done is it to only show the name of the clan in A dropdown menu. So that when users are signing up they can select the clan they want and it well ya you know puts the name beside theres in the table. But can someone make me a script to list all the clans Names and only names not ID, Ceos, and all that other stuff. Code:
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
List Contents Of A Folder, Make List Of Links
Does anyone know how I can write a script that: - reads in all the files in a particular directory - displays the file names in a html list and makes a link of them: <ul> <li><a href="filelocation1">filename 1</li> <li><a href="filelocation2">filename 1</li> <li><a href="filelocation3">filename 1</li> </ul> etc.? So basically it creates a list of links with the contents in that directory, so you can download them from there.
Retrieving Contents Of Select List On Form Submit
On an HTML form, I have a select list that is fed dynamically with detail records when the master record is displayed on the form. There is also a second lookup list, and want to allow the user to dynamically select from this list and add to the first list. I also want the user to be able to dynamically remove from and reorder the first list. I think I can do all of this with JavaScript. The question I have, is how can I retrieve the contents of the first list when the user submits the form? I need to get it back into a php array so I can update and add the proper database records.
Get List Of Messages From One Table, Message List Indicator From
I have two tables. One has a list of messages left by users using fields named mbxno for the mailbox and msgno for the message number. I have another table that has mailbox settings for each user that contains a field named "messagelist" to indicate if they want to be included on the message list or not. What I'm trying to create is a list of the most-recent messages with a lookup on the users table to indicate whether a message in the list should be included in the message list based on the user's mailbox settings. SELECT messages.msgno, messages.mbxno, users.messagelist FROM messages, users WHERE (users.messagelist = Ƈ') ORDER BY msgno DESC LIMIT 100 What I'm getting, though is a list that looks like this: mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 I think what's happening is that I'm using the wrong type of join and more rows are being created than necessary. If I add "DISTINCT" to the query, I get a list of the most-recent messages as I expect, but the "messsagelist" value is sometimes wrong (again, probably because the data is getting jumbled). For example, the messagelist value for the second row (2214) should be 0, not 1. mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 2214 msgno: 0412141622 msglist: 1 mbxno: 2189 msgno: 0412141408 msglist: 1 mbxno: 0000 msgno: 0412141213 msglist: 1 mbxno: 0003 msgno: 0412141213 msglist: 1 mbxno: 2265 msgno: 0412132029 msglist: 1 mbxno: 0000 msgno: 0412131950 msglist: 1 How should I be doing this? If nothing else, what kind of join will work with a long list compared to a value from a short list?
Mailing List Manager, Send To List
I'm looking for a mailing list script (php) that has a function to let users to reach out to all recipient on the list by simple send the email to a specific maillist- address. Mailman has this functionn but as a just got a webserver account I can't use mailman nor install it.
File Get Contents()
I need to verify, (working on the HTML section of a mailer), If in my php.ini: allow_url_fopen is On Will file_get_contents(file URL) called as follow: $mailer->Body = str_replace('{MEMBER_NAME}', $member_name, file_get_content($htmlBody) ); Allows the file to become my email body? where $htmlBody comes from the DB...
Getting And Using Contents In A Folder
I want to make a photogallery/slideshow with PHP... The 'gallery/slideshow' would show up inside a new window. basically, I just want links with possibility to go: - forward - back - to the very beginning - to the very end - away (close the window) Can I use PHP to determine the contents of the folder with the pictures and then use variables to determine which photo to show, and what URL's should be generates for the arrows? So each folder with a series of photographs would have one PHP file and the pictures themselves in them (it's not a problem to rename them). Should be simple enough, but I'm just starting out with PHP, and I'd like to have something working as soon as possible... the website I'm working on is about to launch soon (my first 'commercial' web project :) ), and this is about the only thing left that I still have to sort out how to do...
Add The Contents Of 2 Texbox's
I have designed a form that will display a price (22.34) in a text box, and another price in the other text box... I also have a blank text box... Now I want to add both the prices together and get a total in the bloank textbox.. I got this example off a website sumwhere.. But it does not display the decimal number, it only displays the whole number var number1 = parseInt(document.forms[0].CasesSellingPrice.value); var number2 = parseInt(document.forms[0].AccessoriesSellingPrice.value); document.forms[0].total.value = number1 + number2;
Getting Address Bar Contents With PHP
How do I get the contents of the browser address bar with PHP - assuming it is possible? In javascript it is done with: unescape(window.location.pathname), but is there a php equivalent?
Getting Contents Of Folder
I've made half of the code for a little "hosting" site for a few of the members of my site. Their files are uploaded to /login/<username>/ I'm now stuck as to how to show the contents of the folder in a page. I think the use of fopen() is needed, however the php website is a little confusing.
Getting The Contents Of A File.
Is it possible to get the contents of a file; display the contents in a textbox; and edit the contents of that file. Then click a button and change the contents to the new updated file. The reason I want to know this is because I have programmers on my site and I don't want them to have access to the FTP or cPanel. They will jus enter the name of the file, click submit, be able to edt and replace that file. All without FTP or cPanel.
Display Contents In Mb/gb
i was wondering if it was possible using php to display how much in mb or gb how many files in afolder e.g folder <-- containg 1,000mb of data
File Put Contents
looking to write to a file with out overwriting the previous data? is there a way to turn overwrite off with the file put contents?? im trying to keep a log of form data.
File Get Contents
i am trying the example of get_file_contents but i get the following error. what i want to do is get all the web page of google but the code wont work any ideas please cheers. Warning: file_get_contents() expects at most 2 parameters, 5 given in <?php $content=file_get_contents("http://www.google.com",FALSE,NULL,0,20); echo $content; ?>
Deleting Contents In File With PHP
Hi, I need to get to a specific part of the file and delete a line so i can overwrite it with a new value. Example ... $Money = array( 0 => 10000, 1 => 932394, 2 => 3254#<Money> ); I need to change first choice "0 => 10000" and replace it with "0 => 7500" so it seems like they spent 2500 moneys I dunno if its possible but if it is please help, and thanks in advance FYI, the file is called testfile.inc and i dunno what that .inc means :P I just got it from a script i downloaded Further more, i want to do this change/replace through a form or a click using PHP.
How Do I Email The Contents Of A Webpage?
How do I email the contents of a webpage? My project is coming along nicely and I have it almost completed. It started with putting data into a mysql database and allowing people to select items wanted from a big list. I now can update the database with the quality wanted and I can generate an email to the person however I cannot get the list of items wanted into the email. The list is coming from a mysql database based and comes up in a table type format My question is how do I get the information from the 2nd page into the body of an email?
File Get Contents Issue.
In folder WWW i have text file named news.txt. I'm calling file_get_contents("news.txt"); form index.php in the same folder. I got error: Warning: file_get_contents(news.txt): failed to open stream: No such file or directory in /home/www/index.php on line 14.
File Get Contents - Timeout
I Have googled and founds lots of references and examples of stream_set_timeout for fsockopen, but none showing how you apply a timeout to file_get_contents which I need to use in this case. Can anyone give me a sample of how to set a timeout on file_get_contents, as I understand that it can be applied to all PHP streams? This does not timeout after 2 seconds: $url ="http://www.mydomain.com"; stream_set_timeout($contents, 2); $contents = file_get_contents($url, false); Print $contents;
File Get Contents() Error
I made a PHP5 script that uses the file_get_contents() funtion and when I run the script, I get this error: Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration I called my host up and they said that it is a coding error, not a security or server error, Here is the code: <?php $address = "http://www.example.com"; echo htmlspecialchars(file_get_contents($address)); ?>
Comparing Array Contents
i'm having a small problem with getting information into a database. Basically, i've got a form with some elements in it, such as: name phone address for example. I pass these values to a function which finds out whether the action is associateds with the form is to insert, update or delete info from/to the database (using an HTML "hidden" field.) The field names in my database are the same as in my form. (name, phone etc...). Using mysql_fetch-field, I have an array with the field names in it. I read the values passed from the form into an array called $values with the form fields as keys ? I would like to set the entry as 'NULL' for each field in which there is no data to enter. I thought the best way to do this was by comparing the contents of both arrays, and where there was a key in $values corresponding to the fieldname, somehow assign the contents of $values to that fieldname in the query.
File Get Contents .limitation?
See this simple file_get_contents code <?php $link= 'http://www.example.com' $content=file_get_contents($link); echo $content; ?> I tried the code with these links: 1. http://www.example.com (...worked OK. Also tried google.com, yahoo.com,... all OK.) 2. http://www.example.com/buy/chess (...$content captured an error page instead of the result) 3. http://www.example.com/chessmotifs (...$content returned nil, ... totally nothing. This is the one I need the code to work btw.) Could this be because the site (in this case cafepress) uses some sort of scripts to generate their sub-pages? If yes, is there an alternatif method to "file_get_contents" that allows a page to generate fully before capturing?
Size Of Variable Contents...
We are trying to debug a program that queries an oracle database and reads a LOB. Somewhere along the line from the db to the screen, an initial cr gets added. We can read out the LOB fine using Tcl/Tk, so we know the database data is correct. We now like to know when the additional char gets added, between reading the lob and displaying it.
Set JavaScript Variable To DB Contents
I can get the contents of the my database comments field using PHP. The comments field may include single or double quotes or other strange characters. How do I compensate for these problem characters when I try to set a JavaScript variable? eg.
Is There A Limit To Array Contents?
I'm building a database interface and plan to take the single-column results of a search and stick 'em into an array to pass them on to the next phase in the database search. They will be numeric, each value is probably no more than 8 characters, but the array may have as many as 500,000 values. I know i'm new to php, but this sounds like too many to me. Is there a limit (whether official, technical, or simply for user-friendly purposes) or a general guideline for how many values can be in an array? Here's kind of what I mean for clarification: $array[0] = "00000001"; $array[1] = "00000002"; $array[2] = "00000003"; ... $array[500000] = "00500001"; Will this work?
Checking Form Contents
I would like to verify the contents of a form before inserting the data into a mySQL database. How can I check the contents of the form and return the user to the form if they have not completed all the required fields(with the data they have entered intact). Only after the form is verified to contain all the mandatory data do I want to insert it into the database. In addition, it would be great if I could highlight the fields that are missing data. Currently, I have a php script handling the submission and insertion. Is it possible to make that submission conditional?
Reading File Contents
I am parsing a file delimited by |. For some reason the content is displayed to the browser properly - but the loop is consistenlty outputting "one more row" of just the titles. Perhaps I'm going about it completely wrong: <?php $filename = 'books.file' $fp = fopen("$filename", "r"); while (!feof ($fp)) { $contents[] = explode("|", fgets($fp, 4096)); } fclose ($fp); $loop=1; foreach ($contents as $row) { echo "<b>$loop</b> -------------------<br>"; echo "<b>Reviewer</b>: $row[0]<br>"; echo "<b>Date</b>: $row[1]<br>"; echo "<b>Title:</b> $row[2]<br>"; echo "<b>Author:</b> $row[3]<br>"; echo "<b>Rating:</b> $row[4]<br>"; echo "<b>Comments:</b> $row[5]<br><br>"; $loop++; } echo "<a href="bookreview.html">Insert a new book review</a>"; ?>
Downloading Contents Of A Website
What would be the best way to download the contents of a particular website and define all the content/html as a variable? I'm currently using fopen / fread right now but there is a problem, the script will stall when its reading a missing file (404). Is there a more efficient method besides using fopen / read? If not, is it possible to have the script error when there is a 404?
Check String Contents: Can Be Used As Var?
is there anyway to check if a string could be used a variable name. So return false if the first character isn't a letter or if it contains spaces etc. I started writing a function that would do a load of tests because I couldn't see any easier way of doing it: <? function is_valid_handle($str) { // determines if the string provided can be used as a handle // such as a php variable or html/css class if (strlen($str) > 255)) return false; if (strpos($str,' ')) return false; // incomplete, needs more tests return true; } ?> but as soon as i realised i would have to use range() to check all the characters were valid and all that i decided there must be an easier way. Do you guys know of one or am I just going to have to write it myself? It was about then I had a great idea maybe if you use the variable variable syntax you can see if it will return false but unfortunately it does this: <? $foo= Ƌvery @#bad variable name' $$foo = 'Hi!' // doesn't cause error echo $$foo; // outputs Hi! echo $5very @#bad variable name; // causes an error, obviously ?> Seems PHP will quite happily let you store data in a variable of whatever you like. I guess that's a nice feature. So...any ideas?
If File Contents Equals
I'm trying to create a script that will check the contents of the file and will display a certain message if it does equal the correct value. How would I go about checking a files contents? I tried if (readfile("$file1") == "144.173.19.121") { echo "your ip"; } else { echo "doesn't work";}
Sites Stealing My Contents
I have a growing site that offers statistics and ranking for webmasters. As I expected, some of them started to pull the pages where their stats are, handle them with PHP and show only the items they want to on their sites. Are there any ways to stop that?
File Contents To Variables
I have a file populated with information formated as on many lines: date: person:id:info:info2 please note that : is the seperater. How can I get this data into variables: $date:$person:$id:$info:$info2 I can open the file, display it's contents, even take the : out of it with this code I got from php.net: PHP Code:
Reading Zip File Contents
say i have a zip file - test.zip - with a file - somefile.txt - in it, whose contents are as follows: this is a test when i try running the following script on the above zip file, i get everything i should be getting, save for the contents of somefile.txt (example output follows the script): <? $filename = 'test.zip' if (($temp = zip_open($filename))) { while ($entry = zip_read($temp)) if (preg_match('/.txt$/',zip_entry_name($entry))) { print "file name = '".zip_entry_name($entry)."' "; print "file size = '".zip_entry_filesize($entry)."' "; print "contents = '".zip_entry_read($entry)."' "; } zip_close($temp); } ?> the output is as follows: file name = 'somefile.txt' file size = ཊ' contents = '' the output i would like and expect is as follows: file name = 'somefile.txt' file size = ཊ' contents = 'this is a test'
Need To Read The File Contents
I have a small problem.i need to read the file contents from the url.here is the desc of the problemthe file(local file with compelte path) name should pass thru url(no file upload option)so i need to read that file and store that content in the databasehere is the examplehttp://example.com/read.php?file="D://text.txt"Once i enter this url in the browser, i need to read that text.txt file and store the content of text.txt into DB.
PHP Directory Contents Displayer
I have the following script, which lists files within a specified web directory (as long as they are valid extension types). It works, but I would like the file names to be links (i.e. with hrefs) that allow you to open that file directly from the page. Purpose of the script is purely to display a list of photos within the directory, with links to view those photos. PHP is not my strong-point. Any suggestions would be very gratefully received... Here's the script.... //This function retrieves all files within a directory (non recursive) and outputs them onto the page //You can limit the type of files to retrieve, such as images only, as dictated by the file's extension function getfiles($dirname=".") { $pattern="(.jpg$)|(.png$)|(.jpeg$)|(.gif$)"; //valid image extensions $files = array(); if($handle = opendir($dirname)) { while(false !== ($file = readdir($handle))){ if(eregi($pattern, $file)) //if this file is a valid image echo "$file <br />"; } closedir($handle); } return($files); } //EXAMPLE USAGE: getfiles(); //List all image files within the directory the PHP script is in getfiles("/home/myserver/public_html/george"); //List all image files within a specific directory on the server
Size Of Directory Contents
I want to find the size of all the files in a certain directory. I believe I have to start with: PHP Code:
View Contents Of Directory
I need a script that will display, in a table, all the contents of the folder. Like, for example, its filled with images, there will be a table and in each cell the file name with a link to the actual file. Can someone try to whip this up?
Display Contents Of Subfolders
I am trying to make a script to display contents of a folder and any subsequent subfolders, but I don't know how to move into a subfolder and display the contents.
Viewing The Contents Of A Directory
Is there anyway to view images in a folder using php? I tried asking in perl and a guy replied saying use glob but i dont think we can so is there a way in php.
Determine Contents Of Listbox
How can I determine the values of a listbox, both unselected or selected after submitting the form: Code: <select name="sel1" size="10" multiple="multiple"> <? PHP code populates listbox ?> </select> Do I have to use Javascript to determine the contents, like in the pseudo code Javscript below. But how would you pass the Javascript return value to PHP? Code: function listBoxContents(sel1) { var selLength1 = sel1.length; var valuesPresent1 = new Array(sel1.length-1); var i; for(i=0; i<=selLength1-1; i++) { valuesPresent1[i]=sel1.options[i].valueOf(); } return valuesPresent1; }
Request Url Contents And Parse Xml
I want to accept a movie title into a form field. Once submitted I want to take the search string append to a url and request that url. That url returns xml data that I then want to parse. Code:
Deleting Folder And Contents With PHP
Im using this code to delete a folder using my script but it says Directory not empty. What code could i use that will delete the folder, subfolders, and all its contents. $currentdir = getcwd(); $directory="$currentdir/users/$_COOKIE[username]/albums/$_GET[albumname]"; rmdir($directory);
Check If A Variable Has Contents In It
I am making a user login system, on the main login page it first gets the contents of a "logged-in" session cookie then sets it to a variable. How can i make something that will check if the variable is empty or not?
Open File And Get Contents
I need to open a file and then echo the contents into a text area. I tried file_get_contents(), but it doesn't work, it isn't recognised as a function.. Any other way of doing this?
|