Experimenting With Records Keeping With PhpWiki
How this would work in essence:
User would be presented with, say, a "members" page containing an
alphabetised list of member name links and an add member link. Each
member name link would lead to the member's page and would provide for
updating information about that member in the usual way for a wiki.
However, the add member link would arrange to create a link for a new
member--with initial contents in the linked page set from another file
thereby making it possible to provide for collecting the same
information about each member.
I assume that this is not somehow built into PhpWiki. Does it seem
possible (or would subvert some mechanism on which PhpWiki depends)?
Does anyone know of an example of a system that works in this general way.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Phpwiki Login And Tilde
I have been testing phpwiki on various setup. The main problem currently is that I can't login as administrator Tested with locally: MacOSX 10.2.8 Apache 1.3.X phpwiki 1.3.4 PHP 4.3.4
PhpWiki To Mediawiki Converter In Php Or Perl?
I'm looknig for advice / inspiration / modules / libraries, I'm a little more fluent in perl, but a php solution would also be fine. I'm having two Wiki servers: Server1: - phpwiki with user authentication - direct access to the mysql data base possible - contains about 400 entries Server1: - MediaWiki (Wikipedia is Mediawiki based) with user authentification - direct access to the mysql data base possible - contains about 30 entries I'd like to copy over about 350 entries from Server1 to Server2(I could apply a filter rule or semiautomatically create a list with entries to copy As the amount of entries is low I don't really need an optimized solution. Entries in server 2 can be overwritten. I wanted to have your advice: 1.) Is there already something similiar, that exists? 2.) Is there a Wikiadmin focused news group (I don't like mailing lists and web based forums, as you have to create a noew account for most of them or to increase your spam rate even more) ? If not: I know very little about the wiki internals and was thinking about a 'brute force' method, not knowing if something better exists: The idea: 1.) get all the entries from the phpWiki via mysql ( from table "wiki" ) 2.) fix naming style (my phpwiki entries contain spaces) 3.) replace the phpWiki syntax with Mediawiki syntax (I found url with some sed rules, which are probably incomplete, but could be a goiod starting point) and fix naming styles of interlnal links. 4.) access the Mediawiki via http, authenticate and post the new entries My idea was to 'post' new entries though it is probaly slower than directly populating the mysql data base as this allows to populate Mediawiki without having to know how the internal mysql book keeping works exactly.
Displaying Priorty Records And Normal Records In The One Dataset.
I have a page which displays the records from the database and uses paging to display the records in groupes of 10 per page. I now want to be able to show results depending on the database field (display) in the database (can be set to either "full" or "limited"). If the record and the field display is equal to "full" i want to then display this record at the top of the record set and display all the fields. If the record is equal to "limited" i want to display different results and they must show after all the records which are equal to "full". I can't output two different recordsets as i use paging and only want to show 10 records per page. Code:
Keeping Session ID In Url...
How do I do this? Obviously I have to set a session var called "sessionID" (I think) - and then use sess_id or something to put it into the url?
Keeping Spamers Out?
I'm building a web site for myself and some friends using php and MySQL. All I have coded so far are the index.php, the membership registration screen, and the log-in screen. Myself and one other person are the only two registered members because we are the only people in the world who even know the site exists yet. I'm an experienced C++ coder, but a php beginner, and my friend is a SQL expert but has no knowledge of php. But only two days after putting up the registration page I noticed the welcome screen said we had 3 members, instead of the 2 people who are working on the page. When I looked at the users table in MySQL the user name was this huge long string that read like a typical spam email, so obviously a bot saw a form on my page and tried to fill it with spam. What is the usual procedure for validating members to prevent bots from "registering"? Membership number (auto-indexed) is kind of a status thing, so we don't want the primo low numbers to get chewed up by bots before the site even goes live for the rest of the membership. How can I keep them out?
Keeping Passwords Secure
I'm hosting on a shared server. I need to know how I can keep my passwords, that are currently in the world readable scripts, secure. The problem isn't through the web, but rather that other users have telnet/ssh access to the machine. So they could cd to the directory and copy it see the plaintext password.
Keeping MySQL Connection
Is there a way to open a mysql connection and have it remain open while a user is at my site? Is it better to just keep a connection throughout their visit or connect only when the database is needed? Right now I have these two lines at the beginning of most pages (about 6 pages): mysql_connect($host, $user, $pwd) mysql_select_db($dbase) I was thinking something involving sessions would work, but I am having trouble with it...
Keeping Texts Outside Php Files
I want to keep all messages etc outside php to create a multilanguage site later. What is the best way to do this? I was thinking of a session variable language, and call the text output with a function that receives the messageid and language id and so returns the text. Is it wise to store all these messages in mysql or inside the function (if messageid=1 etc)? Does it make a difference in speed if the function handles all or if the message content is received by mysql query?
Keeping Connection Alive.
I wrote an irc bot,but even if i run it from command prompt as php bot.php,if there is no activity,it disconnects.
Keeping An Array In Memory
I'm afraid I don't know PHP well enough to figure this out. What I would like is to keep an array in memory so that it doesn't have to be reloaded each time a .php script is run. Is this possible? In Java, I could load the array from a file in the init() method of a servlet and it would stay in memory until the server is shutdown or restarted, etc.
Keeping Spam Bots Out
Is there a PHP-way of entering an email address on a .php webpage (as in "If you need info, email us at URL") with this address as a mailto link yet is NOT readable by spam bots who visit the site? I've searched the forum and found lots of "spam' references, but none of them talked about how to obfuscate a regular mailto link.
Keeping A User Authenticated
I've looked through most threads here about user authentication against a mySQL database, but I still have not figured out how to "keep" the authentication as the user browses through the restricted pages. Sessions and cookies seems to be involved, but I still don't understand how it is implemented and checked when a user goes to a different page after being authenticated. I got as far as authenticating the user against the database, but then...
Keeping The 'check' In 'checkbox'
I have a list of checkboxes that are built on the fly from the db. "SELECT id, name FROM $table_name WHERE name !='$startlocation'"; $boxes.="<input type='checkbox' name='attend[]' value='$id' $isChecked>$choosename<br>"; When the user checks one or many and then submits - I loop through the checkbox array to see which values get returned Like so ... $attend[] is the dynamic array for ($i=0;$i<count($attend);$i++) { $boxres.= "$attend[$i]";} Question is - when the user submits the form (to same page) - the checkboxes reset and selections are lost. Is there a way to "mark" checked to those initial selections after the user submits?
Keeping Session Alive
I've built an app for a client that allows selected users to input a load of product sales data, from which returns some handy stats. What's happening is that users are spending a long time over the form input so when the user hits submit (in one case over an hour later) the session has died, the user logged out and the data is lost. Is it possible to maintain a session for that length of time, either via .htaccess or some other cunning piece of PHP ingenuity? or do i have to go away and write a script which captures the form input when it times them out, so it's back there when the log in.
Keeping Values In Forms
I'm trying to process a form. In my data validation function i try and check for errors in the user submitted fields. In the fields in which are fine i want to be able to keep the values in the form when there are errors and clear the fields that have errors in them. For some reason i cannot get this to work. Here's my code, i've cut it down to the relevant parts. The first file is the index.php file which shows the form but first checks for errors. The second file has all the relevant php functions i call defined. In form.php i just show a small piece of the show form function where i try and present a text field with its default value. Code:
Keeping Script From Printing A New Row For Each Entry
My current script prints out a new row for each song title that matches the album_id and the list_id (or playlist id#). What I want to do is to have each song title printed on one row for each album in a given playlist, followed by a comma and a space (except for the last entry). Example--->http://www.twcfan.com/music/playlist.php3?id=1 In the case of this playlist, I would like the song titles "Weekend In Monaco" and "St. Tropez" to be in ONE row, not TWO. So the output on the line that says "Song(s):" would be like this.... Song(s): Weekend In Monaco, St. Tropez SQL query--->$result2=mysql_query("SELECT * FROM albums, songs WHERE album_id='$id' AND songs.song_id=albums.id order by 'artist' asc") or die("No Albums"); while ($row=mysql_fetch_array($result2)) {$bid = $row['album']; if(empty($bid)) { $bid=""; } else { $artist = $row['artist']; $album = $row['album']; ...etc.... I then have a variable called "$bid" that contains the HTML for each row....which I then print $bid.
Keeping The Variables From Form To New Page
On a web page that I am working on there is a lead generator on the left side that asks for the persons name, phone number and email address. Currently when someone fills in that information and clicks "continue" it will send an e-mail as well as inputs that data into mySQL database. What I want it to do is just that but then take the person to a continued form asking more questions, but without them having to re-fill in their name/phone/email. Basically this "continued form" can be accessed seperately, so it cannot be something where the continued form only works once someone fills out the mini form on the left side of any page on the site. Code:
Keeping The Same Session_id When A Page Is Refreshed
I have the following script: <?PHP session_start(); echo session_id(); ?> But it gives a different session_ID() everytime the page is reloaded. Is there any way to keep the same session_ID() until the browser window is closed?
Keeping Select Option Value Selected
I'm trying to learn how to keep the value "selected" once a form is set to read the values and then f-write them (all within a loop). The part that's giving me a problem is the part which would return the value of the form as "selected". PHP Code:
Keeping Your Site Secure From Users
I've got textareas for my users to input descriptions etc into. The problem is that when they enter HTML or PHP code, it comes out like that, which means they could potentially access the database and mess around with the page. How can I keep my pages secure when displaying this text. IE: How can I make it actually say on screen: "Hello, I'm <strong>Grego</strong>" rather than "Hello, I'm Grego"?
Keeping Track Of Page While Logging In
When you try to go to a page that you need to be logged in to see, it first takes you to a login page. Once you successfully log in, it takes you to that original page that you tried to access instead of the default home page. I've been doing PHP for a little while (oh about... 6 or 8 months) so I don't think I need any code, just some structure/pointers because I can't really think it through.
Keeping PHP Database Passwords Secure
I need to save important information, namely my MySQL Database Password in a secure manner somehow. I've looked all around for clues to do this, some things that I found were using config files but I don't know much about them and I couldn't find anything on them here or anywhere else.
Sending Password To Different Pages While Keeping It Hidden
I'm trying to make a very simple administrator's interface for a project I'm working on. The member account information is stored in the MemberTable table and the characters of the members are stored in the CharacterTable table. On admin.php, I want the administrator to enter a password. If it's correct, he can chose what to do. He can either check out the member accounts or the characters. Basically I have 2 links to other pages (users.php and characters.php) from admin.php Here's my code:
Keeping Credit Card Details Secure
I'm building a shopping cart for a small site that need to accept credit card payments. The problem is that payment details need to be sent securly by e-mail, or retreived by the store owner from a secure page for manual processing because the sales volume is too low to pay the setup costs for an online system. What is the best way to do this? Currently they use a PERL script that send half of the details by e-mail (not secure) and stores the other half in a file on the host's server. Is this the best way to do it?
Keeping Users Informed In Lengthy PHP Processes
Often PHP processes take a long time, such as wildcard searching a PostgreSQL database, or generating thumbnails. The PHP host page does not display until the script is complete, so you can not effectively use code such as echo "Converting file ".$Infile; exec(convert $Infile $O8utfile); for realtime feedback to the user. How have others implemented a "progress meter" in PHP processes , one thought I had was to use Javascript redirection to call a PHP page with differing parameters each time .
Forms: Keeping Form Data After Error
WHen using forms, what's the best way to check a database(mysql) for duplicates and return the same form and data if a duplicate is found. Basically, if a user submits a form and an error occurs, let them correct the data instead of entering all data over again.
Keeping Track Of Read Posts (forum)
I have created a forum system and I would like a way to mark forums as read. The problem is at the moment new posts are marked if they have been posted since the user last logged in, this leaves no easy way to mark a particular forum as read. This forum keeps track of which actual posts you have read does it literally keep a list of all the posts and when you last viewed it? Would this table in the database not be huge and require updating and writing to a lot, how else would it work. Maybe my system is wrong, does anyone have any other ideas on this. I would either like the ability for users to mark a forum as read or for the forum to keep track of which posts have been viewed.
Reading (and Keeping) Accented And Special Characters
I'm using the php 'file' command to read the contents of an ASCII text file to a variable. The original text file contains some accented and special characters. The problem arises when I echo this variable: the accented characters are messed up. And not only accented characters, for example, the special characters ª is printed as ª. What can I do to correct this issue? I have tried, without success, to use the 'setlocale' command.
Keeping Track Of What A User Has Read On A Web Site
The goal is to keep track of what a user has and hasn't read and present him or her with new material I am currently doing this by aggregating new content from all databases into a single indexed database and then saving a timestamp in the account database (for the current user) that tells me when the user last read items in the aggregated database. This works as designed, but I don't have detailed control. If the user opens the page where new items are listed and reads on of the items (and don't reset the timestamp), that item won't be removed from the list. This is evident when I want to have a function in my page that alerts the user if there is new content of a specific kind (for example: "1 new articles on cooking"). That function will report that until the user has reset the timestamp (by visiting the 'what's new?' page that lists all new articles). I can't mark just this article as 'read'. So, what options do I have? Well, each item have an ID, so if I should keep track of read/unread I should base that on the IDs in the aggregation database. Looking at how newsreaders (specifically those that make use of a .newsrc file) do it, they keep track of series of ID's, like "12,14-67,69" - which in my case could mean that the user has read the items with ID 13 and 68. The aggregation database looks something like this: ID | Kind | Headline | Original ID ------+-------------+-------------------------------+------------ 1 | article | Home made pie | 23 2 | article | Hamburgers a'plenty | 24 3 | forum | Anyone likes strawberries? | 298 4 | comments |*Re: Home made pie | 67 Get the idea? The ID is the id in the aggregated database, the kind is from what original database the content came from and the original ID is the id in that database So, if I go and read "Hamburgers a'plenty", it should perhaps update my profile to say "1,3-4" or somesuch to note that I have read id number 2. Or perhaps I should just keep track of all the IDs I have read? The aggregate database keeps content around for about a month, which could mean thousands of items. I am guessing that a MySQL query that looked like this: "select * from aggregate where id not in(1,2,3,4,5,6,7,8.....1678)" would be bad. So, I am wondering how YOU would have done - Or are you already doing this in one way or the other? One way - I suppose - would be to make on SQL query that fetches all the (potentially thousands) of ID's and all the headlines and puts them in an array and then I run that array in a PHP function that filters out items based on the "1,4-7,12-78" filter. I would also have to build PHP functions to maintain these lists, but that's a minor problem.
Using A Set Of Arrays Togther And Keeping Data In Sync?
Im using arrays generated from my records displayed in a table on my site to update the corresponding records in a mysql database ie on the web page col1 col2 col3 1 2 2 1 6 2 7 4 which I post to next page as col1array col2array col3array problem is some of the fields in the site's table are blank so the arrays are not in sync ie col1array col2array col3array 1 2 2 1 7 6 2 4 so when I loop through the arrays feeding the values into an update sql the wrong data is going into the wrong rows in the mysql table ie field1 field2 field3 row1 1 2 2 row2 1 7 6 row3 2 4 instead of field1 field2 field3 row1 1 2 2 row2 1 6 row3 2 7 4 how do I get the data in the arrays to stay in sync, in otherwords how can I get the arrays to somehow recognise blanks in the site's table
Keeping Values In Form Inputs After Validation.
How do you put posted values back into form inputs if validation fails. I've tried this: <input type='text' name='title' size='30' maxlength='70' value='<?php echo $_SERVER['title']; ?>' /> This causes ' ' to appear in the input box though. I have no idea why. I figure this is an easy question. I'm not the only one who doesn't want their users to have to fill in a whole new for because of one mistake and not be able to see the mistake.
Keeping Track Of Online Orders, Session Vs Database ?
I created an online order form to accept users' orders and the quantities of each. I have done all of that. Now, I'm asked to create a page to keep track of the quantity of each article ordered. I was thinking about using session to store the values (quantities) of each article ordered. However, as I remember, session can only memorize the stored values up until the browser closes. If so, it will be useless. Should I create a database for this purpose, with each field being an ordering variable ? If so, the ordering quantities will be stored in the database and everytime someone places a new order, the quantities in the new order will add to the existing quantities in the database? Will this be a solution you suggest ?
Keeping Window Open After Running Php File From The Command Line?
I was getting a 500 error and someone adviced me to run the php file from the command line to check what errors that would come up with. Great idea which I'd like to use, but when I use the Windows "run" box to do this, I see a window open and close so quickly that there's no way for me to read what's come up. How can I force the window to stay open after the program has finished ? Just in case it's needed, I run the tests on a Win XP machine with Apache.
Keeping Lots Of Values From Page To Page
I am doing an online questionnaire which is going to have 5 questions per page and upto 100 questions. If somebody hasn't completed the entire questionaire I do not want their data stored in the DB. I was wondering if anybody can tell me the best way to either use sessions to store the data and do a final update at the end, or use a temporary db table to hold the data.
DNS Records
Hey everyone, I'm trying to get a DNS record of an IP using PHP's checkdnsrr() and getmxrr(). I used echo checkdnsrr($REMOTE_ADDR); and echo getmxrr($REMOTE_ADDR); but I receive an error that the PHP build does not support it, but I am using PHP 4.0.5 and in the manual, it shows that PHP 3 and 4 supports the two commands. Any help?
Next N Records
how do I create a "next n records" interface? I want to initially output a specific number of rows, and have a next/previous scenario where the user can click on either and scroll forward or back through the records. I'm currently outputting all rows through mysql_fetch_array: Code:
HOW TO GET HOW MANY RECORDS YOU HAVE IN DB
I finally discover the way how to get what I need. Let's look to my code: ----------------------- CODE ------------------------> $res = @mysql_query("SELECT COUNT(*) AS ToT FROM table_name"); $dato = mysql_fetch_array($res); echo($dato[ToT]); ----------------------- CODE ------------------------> With this code you will get how much records do you have in DB. PS: Whan you think that everything is over and that you are at bottom of trying push harder to see what is under.
Last 5 Records
is there an easy way to grab the last 5 distinct records from an unindexed database? (php/mysql)
Number Of Records
I want to find out how many records, but I am using LIMIT in mySQL so if set the limit to 20 and I have 56 records then it will display 20 instead of 56. I have been using: mysql_num_rows What should I be using?
What To Do If There Are No Records In The Database
I am pulling data from the database and displaying it using the code below: $db = mysql_connect("localhost", "root"); mysql_select_db("pyramid",$db); $result = mysql_query("SELECT * FROM table where area='Wales'",$db); while ($myrow = mysql_fetch_row($result)) { echo "blah blah"; } ?> What do I do if there are no records? At the moment it just doesn't display anything. How do I get it to display a message saying there are no records?
Updating Records
I am know to PHP i've been tring to do this **** for days now could someone PLEASE help me. Ok Im tring make an admin page where user can update multiple records at same time using checkboxes.Im using email as primary key. Here is the code **form page** <form action="update.php" method="post"> <input type="submit" name="submit" value="Select First 10 Names"> </form> **update.php** <?php if ($submit =="Select First 10 Names") { ?> <form method="post" action="<?php echo $PHP_SELF; ?>"> <hr size=3> <?php $query = mysql_query("select * from Names order by Last_Name limit 10"); while($row = mysql_fetch_array($query)) { $first_name= $row["First_Name"]; $middle_name = $row["Middle_Name"]; $last_name = $row["Last_Name"]; $email = $row["Email"]; $photo=$row["Photo"]; ?> <table width="100%" border="0" > <tr> <td align=right width=50%> <?php echo "First Name: <input type=text name="first_name" size="30" maxlength="40"value="$first_name" ><br> "; echo "Middle Name: <input type=text name="middle_name" size="30" maxlength="40" value="$middle_name"><br> "; echo "Last Name: <input type=text name="last_name" size="30" maxlength="40" value="$last_name"><br><br> "; echo "Email: <input type=text name="email" size="30" maxlength="40" value="$email" readonly><br><br> "; echo "Photo: <input type=text name="photo" size="30" maxlength="70" value="$photo"><br><br> "; echo "<input type="checkbox" name="email[]" value="$email"><b>Update?</b> "; ?> </td> <td align=right width=50%> <?php echo "$photo"; ?> </td> </tr> </table> <hr size=3><br> <?php } ?> <input type=submit name=submit value="Update Enteries"> <input type=reset> </form> <?php } if ($submit=="Update Enteries") { if (is_array($email)) { while (list($key,$value) = each($email)) { $query= mysql_query ("update Names set First_Name = '$first_name' Middle_Name= '$middle_name' Last_Name='$last_name' where Email='$value'"); } } } ?>
Need Help With Deleting Records
I'm trying to add a link on the display of a record to delete that record. The main part of the record is stored in pw_event, then there are several rating fields for that record stored in pw_rate, and there is also several records for the first record stored in pw_whois. I need to have a link that will deleted everything for that record in all three tables. Here is my display script: PHP Code:
Retrieving Records With Between
I am trying to convert my asp website to php. So far so good, but I am having a problem with my SQL Statement that needs to us the Between. Here is what I am using: $sql = "Select * From tblTrack Where DateEntered Between $start and $end"; the vars start and end come from the same form. I don't have a problem when I hard code the dates, but when I use the variables, it won't retrieve anything.
Delete Records
I`m just trying to figure out the best method to delete my records and wondered if it was possible to do a DELETE statement to remove any records that don`t match. Here is my code so far: $Query="select blah its huge:-)"; $RESULT=mysql_query($Query); $my_rows=mysql_num_rows($RESULT); for ($a=0; $a<$my_rows; $a++){ mysql_data_seek($RESULT, $a); $Array = mysql_fetch_array($RESULT); printf("%s<BR>", $Array['Email']);} My Query returns Matched Records, what I would like to achieve is deletion of the records that didn`t match, would it be possible to do that under the printf statement. So delete all the records in the table that don`t match up to $Array['Email']??
PHP/MySQL Records Per Row
Is there any way to have the records pulled from a mysql database display like this in a table: record1 | record2 record3 | record4 etc: I've been thinking about this for about three months and have yet to come to a good solution.
Inserting Records
I'm trying to insert as many as records as possible but less than 100 into a table. First, i get the count inorder how many to add and then depending on the count, i get so many blank form fields to enter. Now, I noticed something really strange. 1.Only the last entered record is inserted into the table. 2.For example, when I type a name, Let us assume "WORLD", only w is inserted into the table and the rest is not.It is the same with all the form fields.whether, i'm trying to enter text or a number,only the first character is inserted.This sounds weird. Could somebody pls tell me why is this peculiar behaviour Here is the code:
Insert Records
When I try to insert a records in the database "socios", it doesn't inserted at all. Code:
|