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?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Make Links Active
Im just wondering if there is anyway to automatically make any urls in my page content, into clickable links. Basically I have a small forum I built, and I want to make any URL the user enters, into a clickable link. So if I had www.google.com as plain text, then it would make it into a clickable link.
Active Persistent Links And Active Links Both 0
I just installed Apache/MySQL/PHP I'm trying to test if the connection to MySQL is there I know the database works on its own, I checked that when I run phpinfo() I get mysql listed, I'm just wondering if when it says "Active Persistent Links" and "Active Links" both 0 (zero) under "enabled" column, is that fine, meaning configured properly?
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:
Make An Active Users Script In PHP
I'm trying to make an active users script in PHP, not because I need one, because I want to know if i can. I made one that worked with PHP sessions but then it failed to work with people who had cookies turned off. So, now the script i'm using stored the time and users IP in a flat file. Needless to say it doesn't work for a seemingly unknown reason. It's a pretty small script that I heavily commented so I wouldn't get lost. If one of you more experienced PHP gurus can take a look through it real fast and tell me what's wrong and what I could do to fix it that'd be great. Code:
Automatically Make Text Into A Link
how do I make php search through a $_POST[variable] for a certain set of string, lets say R1000000. Then I would want to turn that string (R1000000) into a link <a href=example.php?id="R1000000">R1000000</a>Then append that link back into the original $_POST[variable] replacing the R1000000, with the link version. I'm sure this is doable, I just have no idea where to start, regex?
How To Make Data Pulled Into Links?
i seem to be having trouble trying to make the hacks that are pulled down into a link for exammple when you select a category it loads all the hacks that are associated with that category, now i need those hacks linkable so that they have there own page for example this will be the link hacks.php?hacksid=hacksid (hacksid being what ever that hack id is) Code:
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!
How To Make Display Links From Mysql Database?
i have the following problem and i am breaking my mind on it: I have a mysql database with (id,title,topic,body) in the database i have stored some documents. How can i display a link with only the title of the document stored?(easy one) but... I want to view the whole document in the same page! Let me explain in code: <?php $ip = "localhost"; $user = "kostas"; $password = "kostas"; $basename = "test"; $table ="docs"; $db = mysql_connect($ip, $user, $password); mysql_select_db($basename,$db); $result1= mysql_query("SELECT * FROM $table ORDER BY id DESC LIMIT 5 "); $myrow = mysql_fetch_array($result1); $title = $myrow["title"]; $intro = $myrow["intro"]; $body = $myrow["body"]; ?>
Mkdir() How Do I Automatically Make A Index File And A Css File
using mkdir() how do i automatically make a index file and a css file. what i really mean is once the directory has been made how do i make it so i have a index and css file there, its just because im making a forum hosting service and i need all the files automatically set up in the directory. how can i do this?
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.
Active Directory / Exchange / Active Directory.
I'm creating an Intranet module for a client (Forum, files upload...etc...etc). This client already has a huge server running on WIN2000 + IIS 4 + Exchange + Microsoft Active directory + proxy and finally PHP 4.03 + MySql. Problem #1 : All passwords are changed every weeks, so I want to be able to import users/pass from Microsoft exchange .... Does anyone have an idea to do such thing with PHP ? Problem #2: I would like that the user logged from the firm's network do not have to log. again when connecting the module. So, is it possible to do such thing ?
No Libphp4.so File Created In Make Intstall Or Make.
I have done a make, and a make install on the 4.3.6 version, using /usr/local/etc/php as the directory I make from. However, no matter what I do, I do not see a php4lib.so that has been created. The documentation I recieved (an IBM source) says that the following has to be added to the httpd.conf file : LoadModule php4_modulelib/apache/libphp4.so .. .. .. AddModule mod_php4.c here is the output from my make install : [root@mail php]# make install Installing PHP SAPI module: cgi Installing PHP CGI into: /usr/local/bin/ Installing PEAR environment: /usr/local/lib/php/ [PEAR] Archive_Tar - already installed: 1.1 [PEAR] Console_Getopt - already installed: 1.2 [PEAR] PEAR - already installed: 1.3.1 Wrote PEAR system config file at: /usr/local/etc/pear.conf You may want to add: /usr/local/lib/php to your php.ini include_path [PEAR] DB - already installed: 1.6.2 [PEAR] HTTP - already installed: 1.2.2 [PEAR] Mail - already installed: 1.1.3 [PEAR] Net_SMTP - already installed: 1.2.3 [PEAR] Net_Socket - already installed: 1.0.1 [PEAR] XML_Parser - already installed: 1.0.1 [PEAR] XML_RPC - already installed: 1.1.0 Installing build environment: /usr/local/lib/php/build/ Installing header files: /usr/local/include/php/ Installing helper programs: /usr/local/bin/ program: phpize program: php-config program: phpextdist
How To Count Links To External Links?
I get results of the query diplayed on my find.php page with links to different web sites. I want to store count of clicks on each of those links that are displayed on my find.php page. How can I do that?
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.
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.
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.
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:
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
Active Row?
I have an sql table with various fields in, one of which is "Active" which is an enum 'y' or 'n'. Basically This table holds different events, of which only 1 may be active at one time. So my question is, is their an easier/better way of doing this kind of thing. At the moment I have to check all rows in the table to find which one has active set to 'y', then if i want to change it, set it to 'n' and set the new row i want active to 'y'.
Active Directoroy With PHP
I have an active directory up and running, i can query against it from the box its on, but when i try and use php to query against it, i dont get anything. It seems to be able to connect, but unable to read the information that is there. Any idea or know where a good tutorial on active directory is? I know that is Microsoft's version of LDAP, but i wondering if there was a special way you had to do things since it is AD.
Active Time
I am wondering if their is a way to have the time update itself without refreshing the page?
PHP And Active Directory
Via a PHP script (running on a LAMP configuration - PHP with LDAP support), I run queries on the LDAP server of our office (users and arguments). Now, I want to put the result of this query (user information) in a Windows 2003 AD. I use PHP-ldap functions to connect with the domain controller: making connection is no problem, but binding (authenticated, I even tried Domain Administrator credentials) doesn't work... Does anyone has experience with this matter (PHP and AD connection/communucation)?
Active Sessions
How do I know how many active conecctions are in my server (with PHP)? I've done it with ASP, and it's WAY too easy, so I guess it should be in PHP.
PHP And Active Directory 2K3
Note: I'm cross-posting the below to nyphp.org as well. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~ I've been struggling with an issue for a few months. I am attempting to search Active Directory 2003 via PHP, but am running into an issue searching from the base DN (i.e. 'cn=company,cn=com'). This seems to be somewhat of a known issue with AD2K3. A search at this level always returns: Warning: ldap_search() [function.ldap-search]: Search: Partial results and referral received If I change my base DN to 'ou=someOU,dc=company,dc=com', searches work properly. I was curious to see what would happen at the command line, so I used openldap's ldapsearch function against AD and sure enough I got a bunch of results that were truncated with ldap_result: Can't contact LDAP server Of note: I have a base php class that sets the following options whenever a bind is created (seems to be necessary for searching AD2K3 at all): ldap_set_option($this->_ldap, LDAP_OPT_REFERRALS, 0); ldap_set_option($this->_ldap, LDAP_OPT_PROTOCOL_VERSION, 3); Anyone have any feedback about how to search the base dn of AD2K3?
Last Active Field
If i was to make a last active field in a members table in my database and had it update the field every page they went on, would this effect anything like speed? I was just thinking if say 100 people are using it at the same time and it's updating the database EVERYTIME someone clicks on a different part of the site, it may get a bit slow or something? Will this happen or is it fine to do this?
Active Sessions
Can you set up something in sessions that shows who is currently logged in? The forum does it, is that in php?
Active Directory And PHP
Is there anyway to work PHP with Active directory? My intention consist in developing an application that authenticates automatically PHP on W2k3 server.
Active Directory Authentication Via Php.
I'm in a bit of a pickle.. at the company where I recently started work, I discovered that the knowledge base we use sucks, and sucks bad (oh Lotus Notes, how I loathe thee, let me count the ways) So for kicks and giggles, I found a nice "personal notebook" solution on the net called: http://www.tiddlywiki.com/ When this had ballooned into a big, nice knowledge base, I discovered that there's a server-side version of it called cctiddly : So as a test I found a free apache/php/sql solution: - copied the cctiddly into it, and the thing worked! As you can see, up until now, no real programming has been undertaken by me, at this point, I've just been at most playing around with installing plugins into my tiddlywiki. Of course, also, now I'm faced with the ultimate question... what's the best way to authenticate people who want access to the wiki? I've researched a bit, and discovered that you can enable LDAP access via php, so theoretically you can authenticate people through AD... which is excellent! People can just use their usual username and password, no need to remember yet another user/pass, and no need for admin to have to control yet another admin control thingum. So I've been testing this out, browsing through information, and as a test I created this: ------ echo "<h3>LDAP query test #1</h3>"; echo "Connecting ..."; $ldap_host = "localhost"; $ldap_user = "user@domain.is"; $ldap_pass = "password"; $connect = ldap_connect($ldap_host) or die ("No Connection to LDAP server"); // must be a valid LDAP server! echo "connect result is " . $connect . "<br />"; if (ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) { echo "Using LDAPv3 <br />"; } else { echo "Failed to set protocol version to 3 <br />"; } if ($connect) { echo "Binding to server..."; $bind=ldap_bind($connect, $ldap_user, $ldap_pass); echo "Bind result is " . $bind . "<br />"; } ---- - Now this works.. if I remove the $ldap_pass in the "$bind=ldap_bind($connect, $ldap_user, $ldap_pass); " line, because then I'm connecting anonymously to the LDAP server... But when I try to authenticate to the server with the password I get this error: "Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Strong(er) authentication required in C:Program Filesxampphtdocs wikiadtest.php on line 21" - which made me go, whu? Now I can't change the settings on the domain controller, as I'm not the sysadmin.. so I need to somehow create a stronger authentication to the server.. now how the hell do I do that? I can't install an SSL certificate, because there isn't one on the server, is there some way for me to make the password meet the bare minimum requirements for a stronger authentication without having to use SSL? An administratoir I know recommended to try to figure out how to use either NTLM or KERBEROS... which is at least perhaps something.
Hightlight Active Link.....
I have this table for links (below), how can I set it up so that whichever section is active then that link is highlighted? PHP Code:
Testing To See If A Page Is Active?
I have a Shoutcast station that is on and off pretty regularly. I'd like to make a "power light" on my website to detect whether the station is on or off. I'm not quite sure what the best language to handle this would be, but I think PHP should be able to do it... The station is basically outputted as a link, like this: http://www.myurl.com:8000/listen.pls If it's on, it pops open the app and goes to town.. If it's off, it gives a "page cannot be displayed error" (I'd like to do something about that, but that's a different story). So basically, I want to query the link, and if it comes back active (or true or 1 or whatever), then it includes a certain graphic; if it's not active (or false or 0 etc.) then it'd include another. I'm thinking it'd be use simple if/else statement, something like this: $radiostatus = *radiostationquery* if ($radiostatus == true) { echo "poweron.gif"; } else { echo "poweroff.gif"; } But I'm not sure what *radiosationquery* would be. Seems like it'd be a pretty simple command. Someone (familiar with coding, but not php) suggested the Get() command might be a way to do it.
Cell Active On The Date
I have a database that has a date such as 2007-12-01 with a inactive colum, what is the best way to have it make that cell active on the date that is in the date cell? So on 2007-12-01 that site would be active.
Active Directory And LDAP
I have a php Intranet, and what I would like to do is hit the Active Directory and bring back the Username, FirstName and Lastname from Active Directory and set them to variables, so I can either display them or insert them into a database. A few things to consider, php is installed on the server, but I don't have access to the server to change any settings. This is just a side project and we are blowing up the existing intranet and going with a Content Management System, so the easier the better.
|