Re: [PHP] Delivering NAMED pdf files
> > And the php page which is fileaccess.php: > > $fp1 = "D:\\Pdf\\" . $fp; > $len = filesize($fp1); > header("Content-Type: application/pdf"); > header("Content-Disposition: inline; filename=$fp1"); > header("Content-Length: $len"); > readfile($fp1); > ?> Have you CHECKED the value of $fp? -- 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] Help converting ASP->PHP
PHP Newbie, so please don't flame me ! I am converting an organizer example from an ASP book to PHP and need some help. Need some help with the following code : /* intMonth and intYear are variables passed into a function datCurrent, intCurrentMonthDays and intWorkDays are local variables */ datCurrent = CDate(intMonth & "/1/" & intYear) intCurrentMonthDays = _ Day(DateAdd("d", -1, DateAdd("m", 1, datCurrent))) intWeekday = Weekday(datCurrent) I can't find any PHP functions to handle this type of day/date manipulation... -- 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] Re: Help converting ASP->PHP
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... >Goto yahoo and do a search for ASP2PHP - it is a script that converts >asp pages to php. Never used it so I can't say how good it works, but >I'm guessing it will do all the basic stuff really well, but db stuff >might get a bit messy. Worth a shot though. > >Cheers >Casey Swenson > Messy isn't the word... Here is how it converted the sample I provided: $datCurrent=$CDate[$intMonth."/1/".$intYear]; $intCurrentMonthDays= $Day[$DateAdd["d",-1,$DateAdd["m",1,$datCurrent]]]; $intWeekday=$Weekday[$datCurrent]; Don't look like it did a very good job, huh? It took Consts in ASP and just made them as scalars instead of using define() Bad product for anything even remotely complex. Besides, any kind of converter like that is bound to screw up... -- 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] Re: Help converting ASP->PHP
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > > function begin_month($timestamp) > { > $a = getdate($timestamp); > return mktime(0, 0, 0, $a["mon"], 1, $a["year"]); > } > > function end_month($timestamp) > { > $a = getdate($timestamp); > return mktime(0, 0, 0, $a["mon"] + 1, 0, $a["year"]); > } > > function weekday($timestamp) > { > $a = getdate($timestamp); > return $a["wday"]; > } > > > PHP Newbie, so please don't flame me ! > > > > I am converting an organizer example from an ASP book to PHP > > and need some help. > > > > Need some help with the following code : > > > > /* > > intMonth and intYear are variables passed into a function > > datCurrent, intCurrentMonthDays and intWorkDays are local This didn't totaly help. This line I can't figure out: intCurrentMonthDays= Day[DateAdd["d",-1, DateAdd["m",1, datCurrent]]]; Basically it gets the number of days in the current month, How to do in PHP? -- 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] Re: Help converting ASP->PHP
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > > > datCurrent, intCurrentMonthDays and intWorkDays are local > > > This didn't totaly help. This line I can't figure out: > > intCurrentMonthDays= Day[DateAdd["d",-1, DateAdd["m",1, datCurrent]]]; > > > > Basically it gets the number of days in the current month, How to do > > in PHP? > > Mr.Baseball, > > have a look at the manual page for the date function > http://www.php.net/manual/en/function.date.php > There is a an option to get the number of days in a month > do a search for 'number of days in the given month' Thanks, that was it...hmmm, it is wonderful when you FULLY read the manual, huh? -- 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] PHP->ASP
Can anyone show me the ASP equivalent to this PHP code I cut from a Weather script? I need to know how to get the response from the server into a string array fo process each line. $weather_url = "http://iwin.nws.noaa.gov/iwin/tx/hourly.html";; $city_name = "AUSTIN"; exec ("$wget_command $weather_url", $raw_contents); // We got the weather data we needed, so we can proceeed $located = 0; foreach ($raw_contents as $line) { // line may wrap in editor if (preg_match ("/^$city_name\s+\S+\s+(-*\d{1,3})\s+(\d{1,3})\s+(\d{1,3})\s+ (\D+)(\d*)\S*\s+(\d{2}\.\d{2})([FRS]{1})/", $line, $regs)) { $temp = $regs[1]; $dewpoint = $regs[2]; $humidity = $regs[3]; $wind_direction = trim($regs[4]); $wind_speed = $regs[5]; $pressure = $regs[6]; $pressurechg = trim($regs[7]); // Falling, Rising, Steady $located = 1; break 1; } } -- 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] PHP->ASP
In article <023601c15de3$c05d8bc0$[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > Is the PHP code you provided below working, I need something like than and i > wonder if i could use it. > NOBBY Actually, right now I'm using some code stripped from the PHP-Nuke Weather add-on. But it gets its weather from msnbc and I'd rather get it from the feds cause they won't change their output. You must know the 4 letter ACCID value, you can get it from NOAA. I use KAUS for Austin, TX like this: http://myhost.com/weather.php?Default_accid=KAUS http://www.msnbc.com/m/chnk/d/weather_d_src.asp?acid= $Default_accid HTTP/1.0\n\n"); // initialize variables $v_City= ""; $v_SubDiv = ""; $v_Country = ""; $v_Region = ""; $v_Temp= ""; $v_CIcon = ""; $v_WindS = ""; $v_WindD = ""; $v_Baro= ""; $v_Humid = ""; $v_Real= ""; $v_UV = ""; $v_Vis = ""; $v_LastUp = ""; $v_Fore= ""; $v_Acid= ""; while (!feof($filehandle)) { $grabline = fgets($filehandle, 4096); $grabline= trim($grabline) . "\n"; if (substr($grabline,7,4) == "City") { $v_City= substr($grabline,15,20); } if (substr($grabline,7,6) == "SubDiv") { $v_SubDiv = substr($grabline,17,20); } if (substr($grabline,7,7) == "Country") { $v_Country = substr($grabline,18,20); } if (substr($grabline,7,6) == "Region") { $v_Region = substr($grabline,17,20); } if (substr($grabline,7,4) == "Temp") { $v_Temp= substr($grabline,15,20); } if (substr($grabline,7,5) == "CIcon") { $v_CIcon = substr($grabline,16,20); } if (substr($grabline,7,5) == "WindS") { $v_WindS = substr($grabline,16,20); } if (substr($grabline,7,5) == "WindD") { $v_WindD = substr($grabline,16,20); } if (substr($grabline,7,4) == "Baro") { $v_Baro= substr($grabline,15,20); } if (substr($grabline,7,5) == "Humid") { $v_Humid = substr($grabline,16,20); } if (substr($grabline,7,4) == "Real") { $v_Real= substr($grabline,15,20); } if (substr($grabline,7,2) == "UV") { $v_UV= substr($grabline,13,20); } if (substr($grabline,7,3) == "Vis") { $v_Vis = substr($grabline,14,20); } if (substr($grabline,7,5) == "LastUp") { $v_LastUp = substr($grabline,16,20); } if (substr($grabline,7,4) == "Fore") { $v_Fore= substr($grabline,15,200); } if (substr($grabline,7,4) == "Acid") { $v_Acid= substr($grabline,15,20); } } $v_City= substr($v_City,0,strlen($v_City)-3); $v_SubDiv = substr($v_SubDiv,0,strlen($v_SubDiv)-3); $v_Country = substr($v_Country,0,strlen($v_Country)-3); $v_Region = substr($v_Region,0,strlen($v_Region)-3); $v_Temp= substr($v_Temp,0,strlen($v_Temp)-3); $v_CIcon = substr($v_CIcon,0,strlen($v_CIcon)-3); $v_WindS = substr($v_WindS,0,strlen($v_WindS)-3); $v_WindD = substr($v_WindD,0,strlen($v_WindD)-3); $v_Baro= substr($v_Baro,0,strlen($v_Baro)-3); $v_Humid = substr($v_Humid,0,strlen($v_Humid)-3); $v_Real= substr($v_Real,0,strlen($v_Real)-3); $v_UV = substr($v_UV,0,strlen($v_UV)-3); $v_Vis = substr($v_Vis,0,strlen($v_Vis)-3); $v_LastUp = substr($v_LastUp,0,strlen($v_LastUp)-3); $v_Fore= substr($v_Fore,0,strlen($v_Fore)-3); $v_Acid= substr($v_Acid,0,strlen($v_Acid)-3); } ?> Weather , Temperature: ° Humidity: % Barometric Pressure: Wind: at mph -- 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] Re: Faking MS Access on MySQL linux box
> What I need is to write PHP pages which manipulate a MS Access DB > via ODBC, because this is what the hosting company makes available > (and it's not going to change because of several reasons) > My suggestion would be to change hosting companies due to their stupidity of using Access as a web database and not willing to offer anything more robust. -- 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] PHP Help required
I would like to know if someone could help create: (All mySQL Tables already created) 1. A Registration page. Needed fields: UID UserName UserPwd UserLevel EmailAddr TeamName (select box loaded from a TeamNames Table) 2. A login page whereby a user enters UserName and UserPwd and gets redirected to form to fill in scores for baseball games. 3. Will select game from games list (loaded from Games Table) ordered by user's teamname. Scores page (already done) to be stored in Games table. Games Table Fields: GameID GameNum GameDate HomeTeam HomeScore VisitorTeam VistorScore Field Division 4. Then when the score is entered for the game that was selected, we will then update the standings (Standings Table), depending upon who won the game. Standings Table Fields: ID TeamName Wins Losses Ties Points (3 points for win and 1 point for tie) {we allow ties} Division The Standings table will already be populated with 0 wins, 0 losses, 0 ties and 0 points The Games Table will already be populated with the season schedule. The Teams Table will already be populated with the TeamNames and Divisions. I already have the Scores page HTML done. I am beginning to work on the Storing of the scores to the Games Table and updating the Standings. I just need help with the Registration and Login pages. I am also currently modifying XMBForum to use on our site, listed below, to replace an EZBoard. It is a very good opportunity to learn PHP, too. Mind you, that I am a somewhat new PHP user but I have done programming before in Clipper, VB, Delphi, ColdFusion and several others. This project will have to go online by 3/31. Our season usually starts the first weekend of April. I will need some testing time to test and debug anything that is written. What would you require to participate in this project? Regards, Eddie Shipman (MrBaseball34 on XMBForum.com forums) Austin Metro Baseball League http://www.austinmetrobaseball.com -- 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] Re: PHP Help required
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > I would like to know if someone could help create: I was kind looking for someone to help show me the way. Not really to do it all. I was just notified by the league pres. that we do not have the budget to pay for anyone else to perform work on the site. We are a not-for-profit league and most all the work done on the site is done for free including our hosting. Sorry if I misled anyone in the NG. Now, if anyone still wants to help... Regards, Eddie Shipman -- 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] Re: PHP Help required
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > Eddie, > > There are some good books to get you started running - literally - with PHP > and a database (usually MySQL). > I would recommend PHP Fast and Easy (blue cover with red writing). Each > chapter focuses on a given task... building tables, then adding to table, > then selecting from a table and - ofcourse - displaying the results. If you > sepnd a week just getting used to PHP (if statements, &c) or you are already > familiar with these constructs, you will very quickly get involved with > MySQL. > Since I am a programmer by trade (Delphi) I purchased "Professional PHP Programming (Programmer to Programmer)" It is a very good book for folks that already have programming experience in any language. I am quite familiar with the syntax as I have been modifying an XMBForum for use on my site. The help I needed on wasn't really as extensive as I first laid out. I have a big part of the work done, just need to tie things together and get access working. I have someone that has volunteered to help and I am quite pleased with him. Thanks for the suggestions, however. E. -- 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] PHP newbie alert
> Being one not to refuse a challenge, I have been asked to administer and > update a PHP based website. I was wondering what a good editor is for such a > task. I have been having a look at Dreamweaver as I use that quite a lot but > are there any extensions I should be using? > If you don't want to spend any money, there's a Homesite clone called !stPage 2000 at: http://www.evrsoft.com. -- 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] Re: php vbulletin and postgres
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > Shaun Murphy wrote: > > > me again. I am going to set up a vbulletin site and I understand it uses > > php along with mysql. I can get php and postgres hosting so I was > > wondering what the differences are in postgres as opposed to mysql. > > > > are they different enough to cause any problems? > My suggestion would be to get one of the DBClasses at http://phpclasses.upperdesign.com and modify your source to use it. They make things much easier when switching Databases. -- 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] Database editor
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > Also try Mascon and FreeMascon. Note, these run on Win32, so the other tool > someone mentioned is not the one and only Win32 tool for this :) > > FreeMason will let you edit tables and such. Step up to Mascon to get > things like administrative editing. > > http://www.scibit.com/Products/Software/Utils/Mascon.htm > This is a Win32-based editor, anything using PHP for the web? -- 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] Database editor
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > As a couple others posted, if you want it to be PHP, then phpMyAdmin, > http://sourceforge.net/projects/phpmyadmin. > I just found that one...thanks... -- 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]