I have tried preg_replace and str_replace but both show \n and \r within the textbox. I want to pull some data out of the database and display it in the textarea to allow for easy update.
The...
Type: Posts; User: smithster; Keyword(s):
I have tried preg_replace and str_replace but both show \n and \r within the textbox. I want to pull some data out of the database and display it in the textarea to allow for easy update.
The...
I have sort of got it working....... The javascript seems to be very erratic though. Sometimes it just won't bother executing it's commands!! For example, I've asked it to reload the page after it...
I have 3 forms all with a hidden input used to choose between 3 different actions.
Here's my javascript code...
if (document.myForm.action.value == 'add_category')
{
var...
My boss has asked me to design a script that allows the end user to switch between texts but I can't use javascript.
I have 2 links....
1st Link...
lol thanks for that Tim. Much appreciated.
The time to not use functions, would that be while I have no clue how to properly use them!!!
I was advised to learn to use them because I tend to...
Well I'd never read through that part of the php manual before, but I did read up on function scopes yesterday at php.net and it talked about using globals which does get this working. But as I...
I've been reading through about passing variables to functions and I can only find references to using globals but I heard that was a bad idea.
Here's an example script...
function...
I've got here a very basic login script which is supposed to create a cookie. I'm having a few problems with it though. Here's what I've got...
Login.php
<?php
...
Ok, a little hard to explain...
This is usually found in a forum or a cms. Users have an id number 1,2,3... and forum threads also have an id number. I'm hoping to expand my PHP knowledge a...
Lets say I have the following table in mysql....
Field Name - |db1|db2|db3|db4|db5|
Data - |db1|db2|db3|db4|db5|
Lets say I want to put all those data entries into a drop down list...
...
Thank you!!! This has been bugging me for a very long time!!! Finally it is now working properly.
Thank you to Jas and to thetestingsite for all your help on this.
Smithster.
Here is what I have tried...
$content .= ''.preg_replace('/[\r\n]/','',$names[$i]).':'.crypt(preg_replace('/[\r\n]/','',$passwords[$i]),base64_encode).'\n';
$content .=...
Thanks Master_script_maker, but unfortunately it does almost the same thing except it does this....
username:password/nusername:password/n
Ah I see. I just uploaded the script to my online server which hosts 4.44 and it doesn't actually work there neither. But it does on my home server which hosts 5.22!!
So, either someone else...
It is probably too old. Are you running a local server? As in a web server from home?
Why don't you try upgrading your version of PHP at least?
The script you posted, even with the <? tag as...
I think it depends on the PHP version. This script works on my version which is 5.22
Just a tip, not all versions of PHP are happy for scripts to start <?
Think you should try replacing it...
Sorry for the long reply again Jas, had to put this on hold for a few days as work has asked of me all the hours God sends!!! Finally finished for the weekend!! So back to this.....
Have never...
It works, you might want to have a look at tidying it up a little though. I'm just off to work so only had 10 mins to put this together. It does work though as I've tested it.
<?php...
Although I agree with Twey, MySQL is a much safer and a better way to go, but here is a script I've put together for you.
<?php
if(isset($_POST['submit'])){
$path =...
mysql_connect(localhost,username,password);
mysql_select_db(dbname);
if (isset($_POST['submit'])){
$text = mysql_real_escape_string($_POST['textdoc]);
$query = ("UPDATE table set something...
Nice one, really wish they taught it at my school. But they didn't. Left college not knowing anything about html let alone PHP. Have had to learn it all by myself really. And with the help of...
Nice one Jas, really does work well now :)
Thanks again.
Sorry for long reply. Been at work all day. Thanks for building this up for me. Works very well. Except for 1 thing!! If a user only puts in 1 username and password, the output is only the first...
lol, hey, people can say what they want!! I been doing this for around a year now. Still a noob I know!! But I'm learning, and enjoying what I'm getting out of it. But this is why I don't post...
lol, well the 3rd edit killed it!! Outputs all on 1 line again now!! Also, no passwords output at all!!!
Didn't realise you wern't able to test this out. No worries if you want to look at it...