Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Editing Posted Bulletins


I have a section on my church website that pulls announcements stored in mySQL and displays them with PHP. I recently started working on a control panel so that other people could login and edit/create the announcements so as to keep it up to date and lighten my load.

I use a while statement to display all of the bits of news but my question is how can I make an edit button specific to each row in the table on mysql? All I need to really be able to do is have an edit button spit out for each post that will set a session variable to that particular posts index number.

I created the mysql table with this in mind and have index numbers to reference the chunks of data.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Using Referal URL, Getting Posted Data, Passing Posted To Include *HELP*
OK.. here is my problem.. I am using PHP as a frontend for executing (actually including) a vb CGI .exe file the include just does the following right now:

<?php
include("http://localhost/test/make.exe?f=$_GET[f]&f2=$_GET[f2]&step=$_GET[step]");
?>

What I need to do is I have a form that needs to have a "Back" button/link and a "Next" button/link .. If they click on "Back" I want it to pass the "Back" as the say... $GET[do] ... needs to equals "Back" if they click back. If they click "Next" it needs to equals "Next" ..

I thought I may be able to detect what URL it is posting from because it is being posted like this:

URL

This would be fine except I need it to retrieve all the data from the form and I do not know if the PHP would get the data from the entire form if you passed it like this it seems like it would only get the posted info in the link..

Is there a way to make the Links as Buttons or keep them as links and then have the links/buttons submit with the different "Back" or "Next" values?

Pls post code on how to do this and I would greatly appreciate it.. This is giving me a headache trying to figure it out! Thanks a lot!

List Of Subjects Which Are Links For Bulletins
I am trying to list all the subjects of bulletins for a logged on user. Code:

Notify Once Posted
While I'm writing a reply to a message, someone else writes one and posts it, now for my site I'll be making a message board. Is there anyway to tell the user that someone has posted a response while they're on the compose screen?

Name Of The Form That Was POSTed?
Is it possible to determine the name of the form that caused a page to
be submitted? I have seen numerous examples of how to determine the
method of the POST and how to retrieve data elements from the post,
but I haven't seen any way to know the name of the form that caused
the post.

The page that is POSTing to my script has two forms and I'd like to
know if I can determine which one of them was submitted without having
to add a hidden element to the forms.

How To Check That Form Is Posted ?
i have a form on a php script - the php script is signup.php, i want to check that when it is submitted when user press the submit button, it will check whether the fields are empty or filled.

how do i check that the user is clicking on the submit button and not going to the signup.php as a link ? because currently, when anyone click on signup.php, it immediately showed the errors (as if the user forgot to fill up the fields - when actually he is just going there from another link ).

<? if(!$name&&!$email&&!$address&&!$phone) { // all not filled up

echo "Error. You must fill up your name..... ";}?>

Escape All Posted Variables?
this works well enough when all the elements in $HTTP_POST_VARS are scalars, but it doesn't work so hot if one or more of them is an array:

<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
while(list($key,$val)=each($HTTP_POST_VARS)){$$key=htmlspecialchars($val);}
[/code]

So what I need is an easy way to tell if "$val" is an Array so that I can do something similar to each of its elements in turn.

Previous Page/Posted From
I wanna know if there's a way to find out what page/file a form was posted from. Or wich was the prevoius page/file that was linked to the currant page.

Faking Posted Variables
I have played with this some unsuccessfully and can't find any
references to it on-line.

What I have is a forms-based application where I POST the form. This
was decided on because of security and the length limits of a URL. Now
I have a need where I would like to link to a form and "fake" some of
the variables that are normally posted.

For example, I have a form that normally comes up where the user
selects information from a combobox and on reload, the fields are then
automatically filled in. I would like to be able to go to that form
from other locations and fake the POST variable of the combobox so that
the form will fill in when they first access it.

Retaining Previous Posted Values
I have a form that if submitted correctly posts back to itself with a message that says the record was entered correctly.

what I would like to do is retain the last values entered in some of the fields so that they don't have to retype everything if they want to add addtional records (it's a list of species and many times phylum, class, order do not change.)

i thought I could do it with session variables but it doesn't work.

PHP/ List Authors That Have Posted More Than X Comments
I'm currently trying to implement sort of a "remember me"-addon to a newsposting script I'm using (cutenews, cutephp.com). What I need is to produce an array that contains comment-authors that have posted a set number of comments to my site. If I set this numer to 5, I want all commenter-names that have posted 5+ comments to be in the array this script is to produce.

The format of the comments database is this: <unique id>¦<comment-authorname>¦<url>¦<ip>¦<comment-text>¦¦ (where ¦¦ means new comment follows - no seperate line for each comment.)

Can anyone give me pointers to where I should start? This problem is really bugging me. 1, I need to search a huge text-file with hundreds of these unique comments, then I need to print a list of the authornames that have posted more than the set minimum number of comments to get listed. I'm going to use this list for a form field where people can select their name...

Outputting POSTed Data On Error
Got a form, user enters information, presses submit, then info added to my database.

however, it checks to see if fields are empty when the button is pressed, if they are empty ive got it to bring up an error to say for example name, postcode empty.

but the form comes back with blank fields i want it so if fields are empty form comes back with the fields that have already been filled in.

Best Way To Encrypt A Form Posted URL String?
Could someone post some examples with explanations of how to
encode/encrypt a form posted URL and then decrypt it, so that it is
very hard or currently impossible to break?

so, something like

http://localhost/page.php?product=12&price=4.50

would appear obfuscated in my browser display area like:

http://localhost/page.php?Ur7@7892yRyw&wq84y@$y8@$ (or whatever)

Reading Data Posted With XMLHttprequest
I'm trying to post a form (using POST not GET) using the xmlHttpRequest
object. I cannot work out how to get PHP (4.1.2) to read the data which
I'm submitting. Everything works fine if I use GET I can just read it
from $_GET. If I use POST nothing appears in $_POST.

To try to use the POST method I'm encoding the fields into a URL
encoded string and sending it as the parameter to the request.send()
function from Javascript. /Something/ is going out because I can see it
in the LiveHHTPHeaders extension to Firefox. Presumably it's being
received by the server. But how on earth do I get at it!?

Identify Server That Posted Data.
I am looking into the security aspects of a site, and would like to know if there is any way to identify the source of the data that is posted to the php page responsible for processing the data. in other words I only wantt he php code to process the data if the data was posted from a form hosted on my server.

Make Forms Keep Data After Being Posted
I'm trying to set up a simple preview-type thing for my very first blog script (im new to php and mysql). First off, heres my code for the update (place to post a new article) page (excluding the includes to connect to the database): Code:

Removing Oldest Table Row When New One Is Posted
im trying to figure out how to make it so that a user can pick how many rows they want to keep stored in a database table before an old one is automatically deleted

im guessing the query would be made, then a while loop would determine how many......ahhh i dont know there has to be a simpler way of doing it..

Reading Data Posted With XMLHttprequest
To use the $_POST global without enabling the raw data in php.ini, try the following code:

objXMLHttpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
objXMLHttpRequest.send('var=value&var2=value2');

Converting The Posted String To The Value Of Html Element
I've been very confused in dealing with posted strings. For example, if I fill in a text element with "(double quote), submit it and display it in a text and a textarea, I get "(backslash followed by double quote) in the textarea element but (backslash only) in the text element.

Code:
<input name="somename" value="<?php if(isset($HTTP_POST_VARS['submitName'])) echo $HTTP_POST_VARS['somename']; ?>" />

I made a function which correct the misbehavings:

Curl Question - Get A Page With Already Posted Data
I would like to get a page with already posted data. I use such code.

$user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";

$ch = curl_init();....

Losing Posted Form Fields Over Https
This has been driving me nuts. I have an application running for several
clients. Some run on http and two run on https. Two weeks ago, the https
customers started occassionally getting kicked out to the home page. This
is not every time, it's generally 1 in 10 form posts. Refreshing the page
asks you to repost the info and it posts as it should have in the first
place. Dumping the $_SERVER variable shows me that if things go well I get
the $_POST and $_GET variables and the $_SERVER["CONTENT_LENGTH"] is a
number. When the error shows up, CONTENT_LENGTH=0 and there are no $_POST
or $_GET variables.

I can only reproduce this over https on Linux/Apache/PHP using Internet
Explorer. I cannot reproduce it using Mozilla or Opera as a browser. And I
also can't reproduce it using IE over https with Windows/IIS/PHP. None of
the PHP code changed and there were no new installations on the server I can
point to as a possible cause.

We were running PHP v4.1.1 and upgraded to v4.3.4. I have been able to trap
the condition to offer our users a page to inform them to refresh so they
won't lose their data.

Any suggestions, ideas, places to look or ask more questions, is much
appreciated.

$_SERVER[SERVER_SOFTWARE] => Apache/1.3.20 Sun Cobalt (Unix) mod_ssl/2.8.4
OpenSSL/0.9.6b PHP/4.3.4 mod_auth_pam_external/0.1 FrontPage/4.0.4.3
mod_perl/1.25

How To Check If The Form Is Posted From My Server Not Other Place?
I have a form index.php, it posts the data to action.php How can I add a check to action.php to make sure that the index.php data comes from my server?

How To Automatically Make URLs Posted In A Forum Active Links?
I've been working on modifying a forum script for some time now and its almost ready to go. You can test it at http://www.designlaunchpad.com/forum if you like. The one additional feature I want to implement is the automatic creation of a link when someone posts a URL in their message. Most forums have this, is it that tough to add in? I'm pretty comfortable editing PHP and understanding what is happening where but I suck at authoring it. I checked the manual at php.net and tried searching this forum and google but keep running into dead ends. So can someone offer me some suggestions or point me toward some help?

INI File Editing...
Does anybody know how to open up an ini file and edit one section?

like find the section called [votes] and just replace the values underneath it, in that section alone?

vote.ini
[votes]
a=7
b=2
c=55
d=0

find that section, replace the values with there new numbers, without having to deal with what sections come before and after this, in the ini file?

Editing A String To Add A Before A '
Is there a function that allows you to add a before a ' in a string.
This is needed to store text in a mysql db and i was wondering if there
is function which can do this to any ' which DO NOT already have one
before them, this is so i can keep editing my text without all these
building up.

Editing HTML/
I'm looking for a way to editing my site on the fly (unfortunately I don't have DB support). I've been messing around with file functions, and that part seems to work fine.

My problem is that backslashes are being added when I post the form I use to edit the files, and if I understand it correctly, I can't just use stripslashes() since there are some backslashes I need to get through (like)Any solution to this?

Editing Rights
Is there any way to allow a PHP script editing rights to every file on its filesystem?

Php.ini File Editing
I need your knowledge,

I want to add to my website php.ini file to change the settings of my
mail() function so that my function is working fine except that the
sender email is not my user but nobody@hostingprovider.com so Someone
told me that its easily edited using php.ini but he dont know how, so
I thought that you could help me in this situation.

more details about my hosting:
- Linux host
- php 4.4.6
- apache

Editing .htaccess
Is there a way to edit a file (in this case .htaccess) in PHP to add a line of code?
EX. What I want to do is add this line to .htaccess: DirectoryIndex main.php?id=5

Editing A Table
is it possible to print a table and then that the user can edit it? My site is for an institute so in a colum will appear all the names of the students and I want that they can give all the notes next to their names, so I was thinking in do it with a table but i dont know if it is possible to edit the table: Code:

Help On Editing PHPBB
I do manage a website and it includes a PHPBB forum, obviously placed at /forum (¿why to use a weirder path? :P). The thing is that my site is more than a forum, it has more content. I have menus almost everywhere, it's very navigable; but if you go into the forum, you can only get back to the other sections of the site using the back buton or removing everything starting from /forum in the address bar. Of course, this doesn't fit my site's philisophy, which is almost to put menus even inside the menus in every page, so you can go from everywhere to everywhere... I hope you cacth it. I've noticed that it shows the domain and title I put in the admin panel. Well, what I'd like to do is to make this text link to my homepage, placed at /index.php or simply /. The problem is that I'm completely lost when trying to do something in PHPBB's source files. I don't know which file should I edit, nor where should I add the code. These files are a code labirynth for me, and I need to edit them to fit my site's needs.

Looking For A PHP App For Editing Pages
Any ideas?  Basically something that would allow me to upload/copy/delete/edit webfiles.  It would probably use a WYSIWYG javascript editor.  Not really looking for a CMS because they don't work with existing html files.

Form Editing
I am trying to call information from a MySQL database in for form of an editable form.  I want the info to be called into a box that can by typed in and so far that works. 

What I want to do next is to be able to change what is in those boxes and click an update button which updates what was called from the database to what I typed in the box.  The code I wrote is below and almost works. I'm not sure what the problem is. Code:

Editing An Xml File
I have an xml file that I use to store information in. I want to be able to add info to it without deleting whats in the file.

Drop Down Box Editing
I have 3 linked drop down boxes ( Eg: Country, State and City ) .  I've  set values for the drop down boxes initially and  I would like to edit the values later. Is it possible to show/highlighte the set values ( the value I've put earlier ) while editing the drop down boxes using  PHP or AJAX.

Editing A Table
i've checked my code like a thousand times and it seems to me there're no syntax errors in it, but I still don't manage to get the damn thing working. It's a script to update an event stored in a db, you can edit both the description as the date of the event. Code:

Editing A Row In A Table
I'm having trouble editing a row. The existing data echoed into the form ok but if I try to change anything and click submit, the error message at the end of the script is echoed. Code:

Editing Data
What i want to do is edit details that have been taken from mysql database and display them in a text box.

I'm under standing what I’ve done so far which was to bring the job id code of the job that i want to edit from another page and i no the code to edit but what i can’t do is display the job data into a text box so it can be seen and edits can be made. All the books and website and forms I’ve read don’t show how to display the data to a text box or it’s so complicated that i don’t have a clue what’s going on? Code:

Editing System Passwords With Php
I need to create a php script that adds new users to my FreeBSD server. I've tried running the 'pw adduser' command through a script, but I can't pass a desired password to it.

I've also tried using the pw command with a password encoded in md5, but I'm still pretty confused about how the encryption works.

Editing The Win32 Registry
Does anyone know if the equivalent of PERL's Win32::Registry module exists for PHP anywhere? If so, I'd be grateful for a push in the right direction.

Editing An Element Within An Array
I have a two-dimensional array that looks like this:
array(
array(0, 123),
array(0, 234),
array(0, 345),
array(0, 456)
)
I want to REMOVE any element that contains 234, and I want to
INCREMENT the first value for any element that contains 345, to make
it look like this:
array(
array(0, 123),...

Editing Info In A File
I am using a tab delimited file to provide information for a page to be displayed. I have used fgetcsv() to get information from the file, and it returns an array of information. I was wondering if there is a way I could change information in the file. For example lets say that $content[2] = "This" how could I change it so that, $content[2] = "That". I know how to change the variable to a different value, but I haven't figured out how to change the actual file.

Editing One Line Of A File.
MySQL ahs been giving me tremendous problems ever since I tried to switch to version 5.0.20. I thought that I might make my own SQL program, out of PHP code.

But if a user of it has a table with hundreds or more entrys, editing one line would take hours. If you can't get PHP to edit one line with a few functions, what about splitting a file into three parts and then merging them together after editing the middle part, like so: Code:

Editing Files In A &lt;textarea&gt;
I've written this program to let me edit ASCII files on my server in a <textarea>. However, if the file that is being edited contains a textarea within it, then I get problems.

what I want to do is read this file into the textarea but I want to convert all of the < and > characters to &lt; and &gt; 's. I figgered you'd do this through Regular Expressions: however these are poorly documented in the PHP book I have, though the Perl book I have tells me how to do this. Could someone tell me how to do this, IN PHP! Code:

Editing Mysql Db Using A Php Form
I am working on a Sig Request database. People submit their request using a form and it's posted into a databse and then displayed beneath the request form. This is working fine. I am having trouble however with my edit.php file.

I want to be able to load a users information, which I have done using this code below. It displays in a form. I change 1 or 2 of the fields, such as the completed field and designer field and click update but it doesn't actually update the database.

The page first lists all the requests. It lists their ID, Name and then it says "Edit this Request" which opens a page with their sig request details in. Here is my code below for the edit.php file. Code:

Editing Multiple Records....
Im trying to make it so that I can sort fo like edit all teh records in a table from one page, and im thinking have it like this:

Field 1.........Field2......Field3..

Record1..................................Button to edit the info in this record
Record2..................................Button to edit the info in this record
Record3..................................Button to edit the info in this record
Record4..................................Button to edit the info in this record

Editing HTML In A Form?
I want to build a very basic online text editor, to allow customers to
modify their own sites' html content using a simple form with textarea
element.

I read the HTML file like so:

<?PHP

function EditText ($filepath)
{
if (!$file = file($filepath)) return false;
foreach ($file as $line) {
$value .= $line; // contains all text in file when done
}
$html = "<html><head><title>Editor</title></head>
<body>
<form method='post' action='processtext.php'>
<textarea rows=&#3940;' cols=&#3980;' name='txt' value='$value'>
<input type='submit'>
</form>
</body>
</html>";
echo $html;
return true;
}

EditText ('/sample/index.html');
?>

The problem comes when the parsed file containing html elements itself
is echoed to the browser. In itself, PHP does what it's asked, but all
browsers I tried choke on the contents of the TEXTAREA field. Best
example may be: try parsing the file containing the script itself, it
becomes a real mess.

I tried htmlspecialchars, this did not fix it. I tried addslashes to
only escape the quotes in the parsed file, also no success.

I saw one example online where 'they' preg_replaced about every possible
(x)html and php syntax element, resulting in an immensely large and slow
script. Can't imagine that's the proper way forward.

If at all possible I'd like to stay away from Javascript. Any idea if
this is a realistic approach? Are there any useable scripts available? I
searched google a lot, but I keep ending up at sites that offer html or
php editors for local use, not in a browser.

Editing A (config) File
I have a file with some configation in it... I am wondering how I
correct single values in there.

The most secure is to recreate the file, then rename it.

But is there a way to correct a line in the text file?
setting1=bla -setting1=blablabla

Needless to say, there are things in there I'd like to keep at all
times.

Editing ID Field In Database.
I have come across a problem with some coding work that i am doing. My problem is the following: Presenters in the radio station, are shown in order of ID.

What i want to be able to do, is edit the order in which they are shown, by editing the ID. My problem, is that when i process the form the script has no way of telling what the field names are, as they are not pre defined, because i have put the code in a while loop, to get all of the DJ's names & id's out. Code:

Editing A Line In A File
I have a php file, I need to open it, find the line that reads "$pass[0]  = "fa03eb688ad8aa1db593d33dabd89bad";" and edit the value
"fa03eb688ad8aa1db593d33dabd89bad". How can I do that, I have

   #Open the file
   $ourFileName = "access.php";
   $fh = fopen($ourFileName, 'r+') or die("Can't open file");
   fclose($fh);


Copyright © 2005-08 www.BigResource.com, All rights reserved