RE: [PHP] 2 newbie questions ;)
1. This should work (notice quotes around var) : INPUT TYPE=text NAME=whatever VALUE=?php echo $var; ? This is incorrect (it only shows the first word) : INPUT TYPE=text NAME=whatever VALUE=?php echo $var; ? 2. not sure about the second question but have you tried removing the target, it seems to me that a target might not be necessary since the link should already be opening an application that is associated with that file type. Robert W. Collins II Webmaster New Orleans Regional Transit Authority Phone : (504) 248-3826 Email : [EMAIL PROTECTED] -Original Message- From: Steve Bradwell [mailto:[EMAIL PROTECTED]] Sent: Friday, April 12, 2002 9:20 AM To: [EMAIL PROTECTED] Subject: [PHP] 2 newbie questions ;) Hi there, I am populating form elements (type=text) with values from a db, but if the string has a space in it, it cuts the string off at the space. eg. $var = the cat in the hat but all you see in the text box is the. is there a function I should be adding to my echo line? Also I have an anchor tag that is a link to open an Access db. For some reason it opens 2 copies instead of one. i have tried the following: a href=..\foldername\microsoft_sucks.mde target=_blankLaunch App/a and a href=file://server/path/ms_sucks.mde target=_blankLaunch App/a but it seems to want to open two copies anyhow, anyone seen this before? Thanks, Steve. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] 2 NEWBIE QUESTIONS
1) Is there any PHP command that'll convert a MySQL database timestamp into a format that humans can read?!! For example, I want to change 20010822001245 into 00:12.45 on the 22-08-2001? ? function dateMysqlToUnix($mysqltime) { $stamp = ereg_replace([^0-9], , $mysqltime); $year = substr($stamp, 0, 4); $month = substr($stamp, 4, 2); $day = substr($stamp, 6, 2); $hour = substr($stamp, 8, 2); $min = substr($stamp, 10, 2); $sec = substr($stamp, 12, 2); $unix = mktime($hour, $min, $sec, $month, $day, $year); //echo Unix timestamp: $unixBR\n; return $unix; } ? You could add a $dateformat input variable, and execute Date() inside that function using it ... but I'll leave that one up to you. This will change it into a unix timestamp acceptable to the date() function. 2) This is the hard question. I have a script that gets values from a database and then includes a php page which contains echo $variable code to get the values from the database onto the page. What I want to do is have the PHP page code in the main script instead of being included externally. So i tried putting the code into a variable and then including, but it didnt work. Then I tried echoing the variable but the PHP code isnt executed. If you dont fully understand my question, mail me. I'm really stuck and NEEDD HELP!!! It sounds like you might be coming at this one from an odd approach... for one, include()'ing a file doesn't execute it externally, and it's probably the best way to do what I think you're trying to do, since you can then change the one include()'d file in order to change all your page layouts... Jason -- Jason Murray [EMAIL PROTECTED] Web Developer, Melbourne IT Work now, freak later! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] 2 NEWBIE QUESTIONS
hey, 1) Is there any PHP command that'll convert a MySQL database timestamp into a format that humans can read?!! For example, I want to change 20010822001245 into 00:12.45 on the 22-08-2001? take a look at: http://www.php.net/manual/en/function.date.php 2) This is the hard question. I have a script that gets values from a database and then includes a php page which contains echo $variable code to get the values from the database onto the page. What I want to do is have the PHP page code in the main script instead of being included externally. So i tried putting the code into a variable and then including, but it didnt work. Then I tried echoing the variable but the PHP code isnt executed. and take a look at: http://www.php.net/manual/en/function.eval.php sincerly, - Kees Hoekzema -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] 2 NEWBIE QUESTIONS
1) strftime(%T on the %D, strtotime($yourdate)); Should produce: 00:12:45 on the 08-22-2001 You can check the manual page for strftime() to see different ways to format the time to your liking: http://www.php.net/manual/en/function.strftime.php 2) The way you're trying to do that sounds a bit unnecessary, but take a look at eval() http://www.php.net/manual/en/function.eval.php -Original Message- From: Georgie [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 22, 2001 7:17 PM To: [EMAIL PROTECTED] Subject: [PHP] 2 NEWBIE QUESTIONS 1) Is there any PHP command that'll convert a MySQL database timestamp into a format that humans can read?!! For example, I want to change 20010822001245 into 00:12.45 on the 22-08-2001? 2) This is the hard question. I have a script that gets values from a database and then includes a php page which contains echo $variable code to get the values from the database onto the page. What I want to do is have the PHP page code in the main script instead of being included externally. So i tried putting the code into a variable and then including, but it didnt work. Then I tried echoing the variable but the PHP code isnt executed. If you dont fully understand my question, mail me. I'm really stuck and NEEDD HELP!!! TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]