Search found 21 matches

by revq
Tue Apr 18, 2006 9:55 pm
Forum: JavaScript
Topic: pass $_POST data into popup window
Replies: 2
Views: 3609

Assuming the info is stored in a db, don't bother with forms, simply have a link where you pass the primary key of the record to the page. eg- <a href="...php?id=2" target="_new">John</a> No need for advanced javascript, just take in the id on the next page and pull that data from the db, display it...
by revq
Sun Mar 26, 2006 10:18 pm
Forum: PHP coding => General
Topic: sumbit & remember data
Replies: 4
Views: 1657

If you want to keep the data there, simply assign values to the fields from the POST data. Initially the value will be null, but if it doesnt route to the other page, the entered value will be displayed.

<input name="NAME" size="25" value="<?$_POST["NAME"]?>">
by revq
Thu Mar 23, 2006 10:21 pm
Forum: PHP General
Topic: Read Image from database
Replies: 5
Views: 2772

Can you show us the code you have? It's easier to debug code if we can see it.
by revq
Wed Mar 22, 2006 4:41 am
Forum: mySQL & php coding
Topic: Date calculation
Replies: 0
Views: 1307

Please see the thread http://www.php-forum.com/p/viewtopic.php?t=7616 This will explain what you need to use.
by revq
Mon Mar 20, 2006 2:26 am
Forum: mySQL & php coding
Topic: Showing partial text from DB cell
Replies: 0
Views: 1605

Once you have the data from the db push it into a command - substr which returns a substring. For 71 characters :-

echo substr($dbdata,0,71);

This will return the first 71 chars from the variable $dbdata
by revq
Wed Mar 15, 2006 10:38 pm
Forum: PHP coding => General
Topic: show previous day from today
Replies: 4
Views: 1707

To do that it is simply a case of instead of saying :-

WHERE date = '$my_generated_date'

say

WHERE date >= '$my_generated_date'
by revq
Mon Mar 13, 2006 10:14 pm
Forum: PHP coding => General
Topic: show previous day from today
Replies: 4
Views: 1707

There is an easy way. PHP comes with a standard function strtotime that will do exactly what you want.
strtotime returns a timestamp so it is necessary to convert that using the date function :- For 7 days ago :-
date("Y-m-d",strtotime("-7 day"));

or date ("Y-m-d",strtotime("-1 week"));
by revq
Sun Mar 12, 2006 11:37 pm
Forum: PHP Scripts
Topic: Form Check
Replies: 0
Views: 3111

You are checking the input for missing fields and if you find it you are echoing an error message and then allowing the script to continue running. What you need to do is to stop it from running, by adding "exit;" to the code, like this :- if(!$visitormail == "" && (!strstr($visitormail,"@") || !str...
by revq
Wed Mar 08, 2006 2:20 am
Forum: HTML Basics
Topic: No Cache Needed !!
Replies: 9
Views: 6855

Your other option is to do a forced refresh - when you see the page hold down ctrl + F5, or hold down ctrl while clicking on the refresh button - it will reload the entire web site, ignoring anything in the cache. This isnt exactly something you can expect the public to do so for a live site, Codito...
by revq
Thu Mar 02, 2006 3:53 am
Forum: PHP coding => General
Topic: Run script automatically when some database condition applie
Replies: 1
Views: 1166

You need a php file that pulls the records from the database where the date is :- date("Ymd",strtotime("15 days ago")); strtotime("15 days ago") returns a timestamp representing 15 days ago accurate to the second date converts this to a readable date format, as the date would get stored in a db. Onc...
by revq
Mon Feb 27, 2006 8:05 am
Forum: HTML Basics
Topic: i want help
Replies: 2
Views: 3666

<input type="hidden" ...> is a field on the html page that holds a value but doesnt display it, anytime you need to store a value in the form but the user mustn't see it, you use the hidden input type. enctype="multipart/formdata" just tells the page that processes the form, in this case "save.php" ...
by revq
Mon Feb 20, 2006 10:47 pm
Forum: PHP coding => General
Topic: a noobs question on variables
Replies: 3
Views: 1581

Agreed about the security issue - however this is not a live production server - it's a dev environment, i assume on a home machine - the chances of being targeted are slim and for simplicity the register globals does make things easier to see. But you are right gesf, no publicly accessible server r...
by revq
Mon Feb 20, 2006 1:39 am
Forum: PHP coding => General
Topic: a noobs question on variables
Replies: 3
Views: 1581

Have you enabled register_globals in the config? You should have this line "register_globals = On" in the php.ini file. If it says off, not on, then change it. Otherwise refer to the variables as $_POST['$FavoriteWord']
by revq
Thu Feb 16, 2006 10:51 pm
Forum: PHP coding => General
Topic: Sending keystrokes to the keyboard
Replies: 5
Views: 1864

OK, I understand what you want. Javascript can simulate triggering events, but this is just basically starting the event handler to handle a click on a button, a keypress whilst simultaneously making that event handler register an event that took place. This is limited in that it can only start an e...
by revq
Thu Feb 16, 2006 6:49 am
Forum: PHP coding => General
Topic: Sending keystrokes to the keyboard
Replies: 5
Views: 1864

Do you mean simulating keys being pressed on the keyboard or someone clicking with a mouse button? I dont believe that this can be done, and if it could I don't see why. PHP is server side code, interpreted/executed and sent to the client's browser as html or images etc... It has no event handling c...
by revq
Wed Feb 15, 2006 11:39 am
Forum: PHP coding => General
Topic: Need Help php login system!
Replies: 2
Views: 1207

Have you called session_start() on any of the pages prior to this? If you havent that would be giving issues when you try to store something in the session, nothing would get stored.
by revq
Wed Feb 15, 2006 11:35 am
Forum: PHP coding => General
Topic: Php error when run script
Replies: 2
Views: 2013

What version of PHP are you using? If it is 4.1.0 or earlier, use $HTTP_SERVER_VARS['HTTP_REFERER'] instead of $_SERVER["HTTP_REFERER"]. As far as I can see, this is the line that is giving the error and that is all I can think of, this being said I have been working hard today and could be having i...
by revq
Wed Feb 15, 2006 3:06 am
Forum: JavaScript
Topic: Question in dropdpown list<select> tag?
Replies: 3
Views: 3571

Have the elements of the list box all with the same name so that javascript can treat it as an array. In the onchange event of the text box, have a for loop that works it's way through all the elements, checking for the pattern, like this if (str.match(/text*/)) where text is the value of the text b...
by revq
Wed Feb 15, 2006 2:42 am
Forum: PHP coding => General
Topic: problem with function 'file'
Replies: 2
Views: 1132

The logic is fine, the error is most probably creeping in from end of line characters in the string read into the array.

Code: Select all

$filecontent = file($filename[$i]);
should be

Code: Select all

$filecontent = file(trim($filename[$i]));
that should work.
by revq
Tue Feb 14, 2006 12:48 am
Forum: JavaScript
Topic: Question in dropdpown list<select> tag?
Replies: 3
Views: 3571

There is no easy way to do this with standard html drop downs. A previous company I was at did something like this, by having a text box, with a floating div underneath containing a list box, not a drop down - it looked something like a normal select box. Then they had code in the onchange event for...
by revq
Tue Feb 14, 2006 12:41 am
Forum: PHP coding => General
Topic: recursive question
Replies: 1
Views: 974

Put the db query in a function, have one line that gets the first results from the db, loops through passing the id to the function. The function uses the id as the parentID to get it's results, loops through those results, passing the id from each row to itself. EG - function a($in) { //db query he...