[PHP] page redirect question
Hi, Is there anyway to redirect php page other than using HEADER(LOCATION:URL) ? Header can only be called if nothing is written to HTML... Is there anyway around it? Thanks, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php array question
Hi, I have a line of php that I don't really understand. foreach($this-orders as $OrderID = $value) { echo $OrderID.BR; $OrderObject =$this-orders[$OrderID=$value]; echo $OrderObject-OrderID.--all the sameBR; } I know that $this-orders is an array of order objects. the result i get from this is: line1. 388--OrderID. line2. 389--all the same line3. 389--OrderID. line4. 389--all the same I'm really confused about why line 1 and line 3 have different OrderID, but line 2 and 4 have the same... I've been trying to fix this bug for 3 hrs with no luck. Any help would be really appreciated.. Thanks a lot -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php array question
But why would the this line generate different OrderID on lines 1 and 3? Ben Ramsey [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Victor C. wrote: $OrderObject =$this-orders[$OrderID=$value]; This line is confusing. $OrderID=$value is either a typo or is just plain wrong. It looks like what it's meant to say is: $OrderObject = $this-orders[$OrderID]; But this will just set $OrderObject equal to $value, so you should just use: $OrderObject = $value; Try that and see if it works. -- Ben Ramsey Zend Certified Engineer http://benramsey.com --- Atlanta PHP - http://www.atlphp.org/ The Southeast's premier PHP community. --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php array question
I did a print_r(array_values)before calling the codes that had errors in it.. the following content is contained in $this-orders; Array ( [0] = order Object ( [UserObject] = user Object ( [UserID] = E2401 [Pass] = [IsValid] = 1 [UserType] = AT [fonthtml] = [footerfile] = resources/footer.php [headerfile] = resources/header.php [Email] = [EMAIL PROTECTED] [FirstName] = Dennis [LastName] = 5 [Salutation] = [Phone] = 123-456-7890 [Fax] = 321-123-4567 [Address1] = 555 Testing Avenue [Address2] = Test 200 [City] = Orlando [State] = FL [Zip] = 12345 [DisplayName] = 52II Rfc [Region] = WEST [OSJ] = 1 [Series7] = 1 [OSJAddress1] = Changed 9:55 Am [OSJAddress2] = [OSJCity] = Des Moines [OSJState] = IA [OSJZip] = [OSJPhone] = 43143431214 [existsindb] = 1 [firsttime] = 1 ) [OrderID] = 392 [CartID] = 90 [TemplateID] = 1 [UserID] = E2401 [completed] = 1 [ordername] = 4312 [existsindb] = 1 [cost] = 3665.2 [totalcopies] = [directmailquantity] = [directshippingmethod] = [overprintquantity] = 4312 [overprintshippingmethod] = [rushoption] = Standard [dl1000instancefile] = 0|C:/Inetpub/wwwroot/printsite/|0|C:/Inetpub/wwwroot/printsite/|0|0|Dennis J. Cunningham II Rfc|Enter your company:|123-456-7890|321-123-4567|Changed 9:55 Am, Des Moines, IA, |C:/Inetpub/wwwroot/printsite/|FALL|2004|C:/Inetpub/wwwroot/printsite/ae gonresources/stockimages/highres/ISI_logo.jpg|Securities offered through InterSecurities, Inc. Member NASD, SIPC and Registered Investment Advisor|Changed 9:55 Am, Des Moines, IA, |C:/Inetpub/wwwroot/printsite/ [flashvars] = 0||0||0|0|341431|Enter your company:|123-456-7890|321-123-4567|Changed 9:55 Am, Des Moines, IA, ||FALL|2004|http://69.44.155.247/printsite/aegonresources/stockimages/lo wres/ISI_logo.jpg|Securities offered through InterSecurities, Inc. Member NASD, SIPC and Registered Investment Advisor|Changed 9:55 Am, Des Moines, IA, | [dbname] = [dbpath] = [age] = [zip] = [gender] = [income] = [home] = [homevalue] = [length] = [children] = [childrenAge] = [marital] = [networth] = [stock] = [listquantity] = ) [1] = order Object ( [UserObject] = user Object ( [UserID] = E2401 [Pass] = [IsValid] = 1 [UserType] = AT [fonthtml] = [footerfile] = resources/footer.php [headerfile] = resources/header.php [Email] = [EMAIL PROTECTED] [FirstName] = Dennis [LastName] = Cunningham [Salutation] = [Phone] = 123-456-7890 [Fax] = 321-123-4567 [Address1] = 555 Testing Avenue [Address2] = Test 200 [City] = Orlando [State] = FL [Zip] = 12345 [DisplayName] = Dennis J. Cunningham II Rfc [Region] = WEST [OSJ] = 1 [Series7] = 1 [OSJAddress1] = Changed 9:55 Am [OSJAddress2] = [OSJCity] = Des Moines [OSJState] = IA [OSJZip] = [OSJPhone] = 43143431214 [existsindb] = 1 [firsttime] = 1 ) [OrderID] = 392 [CartID] = 90 [TemplateID] = 1 [UserID] = E2401 [completed] = 1 [ordername] = 4312 [existsindb] = 1 [cost] = 3665.2 [totalcopies] = [directmailquantity] = [directshippingmethod] = [overprintquantity] = 4312 [overprintshippingmethod] = [rushoption] = Standard [dl1000instancefile] = 0|C:/Inetpub/wwwroot/printsite/|0|C:/Inetpub/wwwroot/printsite/|0|0|Dennis J. Cunningham II Rfc|Enter your company:|123-456-7890|321-123-4567|Changed 9:55 Am, Des Moines, IA, |C:/Inetpub/wwwroot/printsite/|FALL|2004|C:/Inetpub/wwwroot/printsite/ae gonresources/stockimages/highres/ISI_logo.jpg|Securities offered through InterSecurities, Inc. Member NASD, SIPC and Registered Investment Advisor|Changed 9:55 Am, Des Moines, IA, |C:/Inetpub/wwwroot/printsite/ [flashvars] = 0||0||0|0|432141 II Rfc|Enter your company:|123-456-7890|321-123-4567|Changed 9:55 Am, Des Moines, IA, ||FALL|2004|http://69.44.155.247/printsite/aegonresources/stockimages/lo wres/ISI_logo.jpg|Securities offered through InterSecurities, Inc. Member NASD, SIPC and Registered Investment Advisor|Changed 9:55 Am, Des Moines, IA, | [dbname] = [dbpath] = [age] = [zip] = [gender] = [income] = [home] = [homevalue] = [length] = [children] = [childrenAge] = [marital] = [networth] = [stock] = [listquantity] = ) ) 1Object--value. 391--OrderID. 392--going crazy Object--value. 392--OrderID. 392--going crazy Ben Ramsey [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Ben Ramsey wrote: Victor C. wrote: $OrderObject =$this-orders[$OrderID=$value]; This line is confusing. $OrderID=$value is either a typo or is just plain wrong. It looks like what it's meant to say is: $OrderObject = $this-orders[$OrderID]; But this will just set $OrderObject equal to $value, so you should just use: $OrderObject = $value; Try that and see if it works. Nevermind. I read that wrong. $this-orders is an array of objects, like you said, which I glanced over too quickly. My statement above still holds, though. $this-orders[$OrderID=$value] still appears to be a typo to me. It might supposed to be: $OrderObject = $this-orders[$OrderID] which will return the order object at $OrderID location in the array ($OrderID being
[PHP] Re: php array question
Hi Ben, I tried your portion of code and find out what was wrong... Apparently I used in adding order to the array and that was messing things up... Everything is working now. Thanks for all the help Victor C. [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I did a print_r(array_values)before calling the codes that had errors in it.. the following content is contained in $this-orders; Array ( [0] = order Object ( [UserObject] = user Object ( [UserID] = E2401 [Pass] = [IsValid] = 1 [UserType] = AT [fonthtml] = [footerfile] = resources/footer.php [headerfile] = resources/header.php [Email] = [EMAIL PROTECTED] [FirstName] = Dennis [LastName] = 5 [Salutation] = [Phone] = 123-456-7890 [Fax] = 321-123-4567 [Address1] = 555 Testing Avenue [Address2] = Test 200 [City] = Orlando [State] = FL [Zip] = 12345 [DisplayName] = 52II Rfc [Region] = WEST [OSJ] = 1 [Series7] = 1 [OSJAddress1] = Changed 9:55 Am [OSJAddress2] = [OSJCity] = Des Moines [OSJState] = IA [OSJZip] = [OSJPhone] = 43143431214 [existsindb] = 1 [firsttime] = 1 ) [OrderID] = 392 [CartID] = 90 [TemplateID] = 1 [UserID] = E2401 [completed] = 1 [ordername] = 4312 [existsindb] = 1 [cost] = 3665.2 [totalcopies] = [directmailquantity] = [directshippingmethod] = [overprintquantity] = 4312 [overprintshippingmethod] = [rushoption] = Standard [dl1000instancefile] = 0|C:/Inetpub/wwwroot/printsite/|0|C:/Inetpub/wwwroot/printsite/|0|0|Dennis J. Cunningham II Rfc|Enter your company:|123-456-7890|321-123-4567|Changed 9:55 Am, Des Moines, IA, |C:/Inetpub/wwwroot/printsite/|FALL|2004|C:/Inetpub/wwwroot/printsite/ae gonresources/stockimages/highres/ISI_logo.jpg|Securities offered through InterSecurities, Inc. Member NASD, SIPC and Registered Investment Advisor|Changed 9:55 Am, Des Moines, IA, |C:/Inetpub/wwwroot/printsite/ [flashvars] = 0||0||0|0|341431|Enter your company:|123-456-7890|321-123-4567|Changed 9:55 Am, Des Moines, IA, ||FALL|2004|http://69.44.155.247/printsite/aegonresources/stockimages/lo wres/ISI_logo.jpg|Securities offered through InterSecurities, Inc. Member NASD, SIPC and Registered Investment Advisor|Changed 9:55 Am, Des Moines, IA, | [dbname] = [dbpath] = [age] = [zip] = [gender] = [income] = [home] = [homevalue] = [length] = [children] = [childrenAge] = [marital] = [networth] = [stock] = [listquantity] = ) [1] = order Object ( [UserObject] = user Object ( [UserID] = E2401 [Pass] = [IsValid] = 1 [UserType] = AT [fonthtml] = [footerfile] = resources/footer.php [headerfile] = resources/header.php [Email] = [EMAIL PROTECTED] [FirstName] = Dennis [LastName] = Cunningham [Salutation] = [Phone] = 123-456-7890 [Fax] = 321-123-4567 [Address1] = 555 Testing Avenue [Address2] = Test 200 [City] = Orlando [State] = FL [Zip] = 12345 [DisplayName] = Dennis J. Cunningham II Rfc [Region] = WEST [OSJ] = 1 [Series7] = 1 [OSJAddress1] = Changed 9:55 Am [OSJAddress2] = [OSJCity] = Des Moines [OSJState] = IA [OSJZip] = [OSJPhone] = 43143431214 [existsindb] = 1 [firsttime] = 1 ) [OrderID] = 392 [CartID] = 90 [TemplateID] = 1 [UserID] = E2401 [completed] = 1 [ordername] = 4312 [existsindb] = 1 [cost] = 3665.2 [totalcopies] = [directmailquantity] = [directshippingmethod] = [overprintquantity] = 4312 [overprintshippingmethod] = [rushoption] = Standard [dl1000instancefile] = 0|C:/Inetpub/wwwroot/printsite/|0|C:/Inetpub/wwwroot/printsite/|0|0|Dennis J. Cunningham II Rfc|Enter your company:|123-456-7890|321-123-4567|Changed 9:55 Am, Des Moines, IA, |C:/Inetpub/wwwroot/printsite/|FALL|2004|C:/Inetpub/wwwroot/printsite/ae gonresources/stockimages/highres/ISI_logo.jpg|Securities offered through InterSecurities, Inc. Member NASD, SIPC and Registered Investment Advisor|Changed 9:55 Am, Des Moines, IA, |C:/Inetpub/wwwroot/printsite/ [flashvars] = 0||0||0|0|432141 II Rfc|Enter your company:|123-456-7890|321-123-4567|Changed 9:55 Am, Des Moines, IA, ||FALL|2004|http://69.44.155.247/printsite/aegonresources/stockimages/lo wres/ISI_logo.jpg|Securities offered through InterSecurities, Inc. Member NASD, SIPC and Registered Investment Advisor|Changed 9:55 Am, Des Moines, IA, | [dbname] = [dbpath] = [age] = [zip] = [gender] = [income] = [home] = [homevalue] = [length] = [children] = [childrenAge] = [marital] = [networth] = [stock] = [listquantity] = ) ) 1Object--value. 391--OrderID. 392--going crazy Object--value. 392--OrderID. 392--going crazy Ben Ramsey [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Ben Ramsey wrote: Victor C. wrote: $OrderObject =$this-orders[$OrderID=$value]; This line is confusing. $OrderID=$value is either a typo or is just plain wrong. It looks like what it's meant to say is: $OrderObject = $this-orders[$OrderID]; But this will just set $OrderObject equal to $value, so you should just use: $OrderObject = $value; Try that and see if it works. Nevermind. I read
[PHP] PHP and send XML
Hi, I'm trying to pass XML file from Site A to Site B for Site B to parse. Site B is maintained by other company, so I only need to worry about sending over the XML file. I've been hinted that fsockopen() can do the job. I've done the following through PHP: $port=80; $host=134.134.134.134 $data= POST /folder1/ HTTP/1.0 Host: 134.134.134.134 User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) Content-Type: application/x-ddif Content-Length: 301 blabla version100/version securityTYPE1/security authrq tsclient20041028065058:534Pacific Daylight TimeBR/tsclient appid/appid appverappver /authrq profrq localeen_CA/locale /profrq /blabla then i wrote in PHP. fclose($f); $result=; echo $f=fsockopen($host,$port, $errno, $errstr, 30); fputs($f,$msg,$data); while (!feof($f)) $result.=fread($f,32000); fclose($f); echo $result; Since I still do not have the HOST info. on site B. I'm doing testing by setting the $host to be my own site (ie, Site A's) host ip. Right now when I execute the code, the page just keeps on running and nothing shows up.. Is this how it's suppose to behave? Thanks a lot. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Millisecond in PHP
Hi, I'm trying to get PHP to display the millisecond of current time. I can't find that option in Date().. Any hints? Thanks a lot -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Millisecond in PHP
Thank you all for answering! Really appreciate it. John Nichel [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Victor C. wrote: Hi, I'm trying to get PHP to display the millisecond of current time. I can't find that option in Date().. Any hints? Thanks a lot http://us4.php.net/manual/en/function.microtime.php -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Timezone
Is there a way to get PHP to display the full name of time zone? date(t) only displays in the format of 'EDT', 'PDT', etc.. But I need the full name of the timezone, ie. Pacific daylight saving time. I know I can hard code all of these using switch statemetns. I'm just wondering if there is a function that's already build in. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] file upload
Hi, I'm trying to submit a file from index.php to index2.php. I know how to do file upload in PHP. On index.php I have: FORM ACTION=index2.php METHOD=POST ENCTYPE=multipart/form-data INPUT TYPE=file NAME=myfile SIZE=30 INPUT TYPE=submit NAME=Upload File /FORM The next page would only need to use $HTTP_POST_FILES['myfile'] to access the submitted file. My question is: if I already know which file I want to submit, say file1.xml. How can I just ask index.php to submit file1.xml to index2.php? Without asking the users to pick the file to upload? Thanks a lot in advance! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file upload
Thanks for answering Chris.. What if I want to send a file from my web server to another site for them to parse? I already know what file I want to send and I do not want to have to select the file by doing browsing. Chris [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] You can't, at least you SHOULDN'T. Just think about what you're asking for, you want to download a file from a users computer, without them knowing about it. Major security/privacy issues there that browsers try to prevent. Chris Victor C. wrote: Hi, I'm trying to submit a file from index.php to index2.php. I know how to do file upload in PHP. On index.php I have: FORM ACTION=index2.php METHOD=POST ENCTYPE=multipart/form-data INPUT TYPE=file NAME=myfile SIZE=30 INPUT TYPE=submit NAME=Upload File /FORM The next page would only need to use $HTTP_POST_FILES['myfile'] to access the submitted file. My question is: if I already know which file I want to submit, say file1.xml. How can I just ask index.php to submit file1.xml to index2.php? Without asking the users to pick the file to upload? Thanks a lot in advance! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file upload
See... basically, I have two sites. One site provides user authentication and another one requests the authentication. The requesting site need to send to the authentication site its request in an XML. The authentication site is suppose to get the XML file using $HTTP_POST_FILES. I'm using PHP to dynamically generate the request XML file and I need to submit it to the authenticating site; but I don't want to use file upload and browse functionality, because the authentication process is suppose to be transparent to the end users. Again, thanx for the help and any insights would be greatly appreciated. :) Chris [EMAIL PROTECTED] ??:[EMAIL PROTECTED] Server to Server transfers are a bit different. There are MANY ways to do it. You can put the file in the document root of one server, and download it with the other server. Or you could FTP the file from one server to the other. Just 2 examples. And, you could even POST the file from one to the other. That solution seems a bit icky to me, but it all really depends on what you need. Pulling is generally easier than pushing. Chris Victor C. wrote: Thanks for answering Chris.. What if I want to send a file from my web server to another site for them to parse? I already know what file I want to send and I do not want to have to select the file by doing browsing. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php, mySQL query character problem
Hi, I have a query to mysql basically saying: $query = select * from table1 where colum1 like '$email%'; //where $email is defined string. When i echo $query, I get the string : select * from table 1 where colum1 like 'testdata%' If i copy paste the string into phpMyAdmin SQL, the query executes successfully and returns one record. However, when I just do$returnValue = QueryDatabase($query); echo mysql_num_rows($returnValue); I always get 0 for the # of records. Does anyone know what causes this? Also... the value i have for $email is from: $email=explode(@,$emailAddress); $email=$email[0]; Thanks, Victor C. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] syntax questoin
Hi, I just started with PHP. (I used to work on ASP a lot) What does the syntax .= do? i see a line of code that says $Msg .= Test is complete I'm thinking it means concatenate $Msg with Test is complete and then store the new string into $Msg Am I right? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php