[PHP] converting GET to POST
Currently, I am posting via GET to third party server as seen below: $item=urlencode($item); header(Location: https://www.fake.com/fake.php?item=$item;); I want to reconfigure my header calls to POST instead of using GET for sending $item to third party server. Is this doable? Thank you, Kris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dates
Also, an option is to have that SQL field set as date. With postgres, I can insert 09-12-1967 and the sql server auto converts it to 1967-09-12 upon saving into date field. However, another way is.. ? $date=09-12-1967; $dARR=explode(-, $date); $tmon=$dARR[0]; $tday=$dARR[1]; $tyr=$dARR[2]; $newdate=$tyr-$tmon-$tday; ? Jay Blanchard wrote: [snip] Ok, Mayve I need to be a little clear, I under the link below as showing dates. What I need to know how can I take the input of 09-12-1967 and have enter into a mysql data using php as 1967-09-12? Because everything that is past from my form to mysql is not the way it was enter. Would I need to create three fields month, day, year, then take those three into -mm-dd? If so how? [/snip] Aha. $theOldDate = 09-12-1967; $theNewDate = substr($theOldDate, 6, 4).-.substr($theOldDate, 0, 2).-.substr($theOldDate, 3, 2); echo $theNewDate; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] User Authentication Continued....
I guess you would either need to make the vars global or else keep redeclaring them. Obviously, redeclaring them in each function $var=$_GET[whatever] is technically the more secure method. Kris Jeff McKeon wrote: Ok, I've got the user authentication thing down and now I'm continuing to build my trouble ticket tracking system. So from a customer profile page there is a link to Open Ticket which brings up a page to open a trouble ticket. [html code] HREF=./open_ticket.php?custid=$custidcustname=$custname [html code] The user is validated for permissions and timeout based on the $_SESSION variables established before the open ticket page is loaded. I then have a form that they fill in with the minimum info to create a new ticket. Some info is passed to the open ticket page from the customer profile page via a GET method and enterred into hidden form fields. [html code] HREF=./open_ticket.php?custid=$custidcustname=$custname [html code] On the open ticket page I have 2 functions, the first is a form for entering in the ticket info, the second is a function to take the information and update the database with it when the form is submitted, then reload the page with a display of the ticket info. The problem I'm having is with the $_GET variables. I guess I'm not declaring them correctly. Do I need to set them as soon as the page loads, and outside of any functions like so.. [code start] $custid = $_GET['custid']; $custname = $_GET['custname']; [code end] Or do I need to declare them in each funtion? [code start] Function blah(){ global $custname, $custid; $custid = $_GET['custid']; $custname = $_GET['custname']; DO SOME STUFF } Function foo(){ global $custname, $custid; $custid = $_GET['custid']; $custname = $_GET['custname']; DO SOME STUFF } [code end] Or am I way off and there is another way of doing it? Also I've noticed that when I do an mysql_query(select name from foo where name='$somevariable') I cannot use $_GET['somevariable'] or $_POST['somevariable'] in the sql string, I find I need to do a $name = $_GET['somevariable'] first and then use $name. Why is this? Thanks, Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] abreviating echo commands
Hello.. I forget where but I found some source awhile back that abbreviated echo. It was something like ?=$var;? which worked the same as ? echo $var; ?. Maybe it was ?\=$var;?.. Obviously I dont remember.. which is why I am asking.. :) Does anyone have a link to something that talks about how to abbreviate commands in PHP? Well.. not how to.. but just a list of abbreviations? Is echo the only one that has an abbreviation? I couldn't find anything in the manual.. any leads? Thanks, Kris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Foreach POST VARS problem
It seems to me that this used to work but I guess something has changed somewhere between PHP 4.2 and 4.3? I am running PHP 4.3.2 as an Apache DSO on an FBSD box. If it is not obvious, I am trying to parse checkbox form POST results as seen below: $colors=; foreach($HTTP_POST_VARS as $ThisVar=$ThisVal){ if(ereg(color-, $ThisVar) AND $ThisVal==on OR $ThisVal==1){ $newVarA=explode(-, $ThisVar); $colors.=$newVarA[1]:; } } *Warning*: Invalid argument supplied for foreach() in */devda1/htdocs/2binteractive.com/htdocs/0new/content/lanskyShopAdmin.php* on line 2 I guess I just need to know what this variable name has been changed to. I searched the PHP.NET manual for $HTTP_POST_VARS and got no results. Thanks in advance sorry for the dumb question.. Kris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Screen Resoultion
Leif K-Brooks wrote: [EMAIL PROTECTED] wrote: i didnt understand a word of that , please rephrase ?? ASP doesn't do an upload meter by magic. PHP can do anything ASP can do, it simply doesn't have built-in features for anything unessential. So true.. I use PHP a lot to dynamically generate DHTML and JScript, which of course are tied to ways to get data back to PHP from jscript/dhtml results. My latest project is dynamically generating cool menus using Thomas Brattli's Coolmenus library (jscript/dhtml) with PHP and database results. A while back, out of sheer boredom, I wrote a PHP script which dynamically generates a PHP script using database results, saves it to a database, and then grabs and executes the new script. I havent used that for anything except playing around and burning time/killing boredom. However, I also have a PHP program which you can run and edit the source code for the program inside the program itself, hit render and all of a sudden you are running the new version of the program. It is so cool that it is just plain sick. I use this methodology all the time - every day, everyone loves it, and my fridge has good food in it as a result. My point is that nothing is impossible, it is all just a matter of how you perceive things and how you react to these perceptions. Free your mind and the paychecks will follow, not to mention good code will just flow from your fingertips. :) Kris http://2binteractive.com http://doomstar.com/?target=me -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Screen Resoultion
Chris W. Parker wrote: Kris Yates mailto:[EMAIL PROTECTED] on Friday, August 15, 2003 11:55 AM said: However, I also have a PHP program which you can run and edit the source code for the program inside the program itself, hit render and all of a sudden you are running the new version of the program. It is so cool that it is just plain sick. I use this methodology all the time - every day, everyone loves it, and my fridge has good food in it as a result. Hhmmm... tell us more. c. Basically it is just a lean and mean content editor I wrote that saves anything (html, php, yada yada-you-name-it) to a database. I use it inside an environment framework system I created which controls logging in and using the editor. So you go to the 'site', log in, and then you can run the editor and whatever other apps you have been given user-level access to. Your access level also determines what content you can access. Low level access users can edit only their own content. Super elite users can view/edit all content of all users, and as well can edit the HTML/PHP, etc. of the site itself. As super user elite, you can also select the content editor and edit the source code (PHP) of the content editor. Really, you can edit any application that is inside the environment framework system. ...hmmm.. Based on a setting defined for each peice of content in the database, when you click 'render', some PHP files may be written to a specified file system while other content 'chunks' stay in the database and never rendered out as files. These chunk files can but do not contain PHP... this is used for just content or referencing actual content chunks.. so I created a very basic macro psuedo language using PHP.. I call it metaChunk but I imagine the name may already be taken, otherwise this email acts as my copyright to that name according to the Berne Copyright convention. :) LOL ... An example of a content 'chunk' as seen in the editor (just an example that does not *really* exist - just typing junk from my head that would parse): bHello !!$:varuser!!bbr You have logged in !!$:logins!! timesbrbr !!displayChunk:menu.js!! !!displayChunk:userscreen!! !!includefile:funk.php!! The output is of course an HTML document that the end-user sees in ye olde browser. This is all a couple of years old and since then I have found others that have developed similar things.. lots of CMS systems and macro languages. someone said my metaChunk psuedo lang looks like struts, which I have yet to see for myself or bother to read about. So Chunks can include and run PHP, display and render other chunks, and display variables. One day I may expand it. I'd like to release all this to open source but I just cant afford to do that yet, and a contract with my employer is another deterent. I am guessing others out there are in the same boat. I have been PHP'ing since late 98 but working on this stuff specifically since 2k. In my 3 years of developing this stuff, I have made a point to not examine open source code so as to keep everything 'original'. I am just an old school programmer/ex hacker from the 80's that refuses to rip others off as I have already been ripped off a time or two in the past both in the music biz and the technology biz, including *major* media companies to say the least If you were to put ? echo Hello, World!; ? inside the database as a content 'chunk', it will just display the PHP to the web-browser instead of actually executing the code. All in all this whole deal just makes my life easier since I dont need my users being able to exec any code. Just FYI, this project started in late 2000 after my return from Los Angeles where I was recording at Paramount. I bought a Commodore 64 SX at a yard sale for $5.00 US. I got a copy of CNET 10.0 BBS out of a dusty old box and set it up for fun. It became my reference point for the first few months to create a BBS like system for the web which was similar to the old days of BBS, unlike the majority of BBS type systems on the web today. Just trying to be unique and different in my own old-school way. I blab about all of this vaguely at my doomstar.com site, which implements these tools and my employer is also allowing me to reuse my codeBase in applications I develop for their clients. Note to all: please send private replies as any further discussion could quickly become 'off topic' for the php-general list. I am interested in meeting other like minded people whom already know how to code and just want to throw ideas around for fun and inspiration. Thanks for you interest in my work! It is greatly appreciated. Kris http://doomstar.com/?target=me -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Bug in Ereg?
Hi, I have a form with checkboxes that POSTs to a PHP script. What is posted [ from phpinfo() ]: _POST[color-1] on _POST[color-4] on _POST[color-6] on Parser: foreach($_POST as $ThisVar=$ThisVal){ if(ereg(color-, $ThisVar) AND $ThisVal==on OR $ThisVal==1){ $newVarA=explode(-, $ThisVar); $colors.=$newVarA[1]:; } } Expected Output: $colors=1:4:6:; Real Output: $colors=:1:4:6:; I can work with the output I am getting, however, I am curious why I am not getting the expected output. Can anyone shed light on this? I am using PHP 4.3.2 compiled under a unix environment. Is this a bug in ereg or am I just not seeing something obvious in my foreach? Thanks, Kris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Bug in Ereg?
Just an addendum.. My parser has $colors=; right before the foreach loop. Kris Yates wrote: Hi, I have a form with checkboxes that POSTs to a PHP script. What is posted [ from phpinfo() ]: _POST[color-1] on _POST[color-4] on _POST[color-6] on Parser: foreach($_POST as $ThisVar=$ThisVal){ if(ereg(color-, $ThisVar) AND $ThisVal==on OR $ThisVal==1){ $newVarA=explode(-, $ThisVar); $colors.=$newVarA[1]:; } } Expected Output: $colors=1:4:6:; Real Output: $colors=:1:4:6:; I can work with the output I am getting, however, I am curious why I am not getting the expected output. Can anyone shed light on this? I am using PHP 4.3.2 compiled under a unix environment. Is this a bug in ereg or am I just not seeing something obvious in my foreach? Thanks, Kris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHPSESSID auto-append
What php.ini setting causes the following: A link in a document a href=index.phpindex/a gets modified by PHP, so that the end-user sees a href=index.php?PHPSESSID=(*Uwhatever*$GIODGindex/a in the source? How do you turn this off? Thanks, Kris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Where do I post loadable extensions questions? (semi-multi-part)
Hi, Is there a better list for posting question about creating loadable extensions (.so) for PHP? Or is this [php-general] the best place to post? Also, I saw a post on another PHP related site that said this was not C, but some kind of C macro language? - - but you can use real C code? Confusing... Can someone define more clearly what I am actually writing? I have successfully recreated the demo extension found in the manual, and have created/compiled some other basic modules with only minor problems/guesswork involved. At this point, I am limited by lack of documentation in the PHP manual, and my lack of knowledge of C. I am picking it up [C] rather quickly due to just not being a novice at programming (ie. PHPing since early '98). I have found no other source code examples of modules except the one in the manual. Does anyone have any links or samples? Thanks, Kristophari -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Anchor Collector
http://192.168.0.1/index.php?DSE=matrixaccess=31337#herd 1. Grab the Anchor reference herd from the fake URL above and store it as a variable using PHP. You already know the facts... QUERY_STRING: DSE=matrixaccess=31337 REQUEST_URI=/index.php?DSE=matrixaccess=31337 HTTP Request: Get /index.php?DSE=matrixaccess=31337 PHP_SELF=/index.php _REQUEST[DSE]: matrix _REQUEST[access]: 31337 and same for _SERVER vars per normal PHP operation. So, does anyone have any ideas? I was just going to ereg and parse it out to a variable but PHP cant 'grab' the anchor passed as part of the URI requested. According to what I have found, browsers dont send the anchor in the URI but use the anchor locally within the page. This is okay, except when the index.php dynamically generates frames containing references to dynamically generated pages. I want to pass the anchor in one of the frames. So far, my conclusion deems #1 impossible. I am hoping someone can prove me wrong. Kristophari -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Spammer! Re: [PHP] ANNOUNCING: Rekall V2.0.0 for Linux/UNIX....
With all due respect to everyone, including the alleged spammer, this has been my rule since '84. If you are in a discussion group, dont advertise something unless someone posts a question where a product would act as a specific solution to their specific need. The advertiser would then be expected to mention how exactly the product advertised affects the output of the question, or solves the problem posed by said question. Obviously, this thread should be either moved to another list or else just killed since spam has no direct links to PHP, nor did Rekall have any direct link to any question posed on the PHP general list. Ultimately, it is the list moderators responsibility to establish a set of core rules for interaction inside this 'virtual world' we all use to help others learn PHP. I do not know that this list has any core rules defined. On my lists, where rules are not defined, I just delete spammers without warning or notice, and furthermore ban that email address from the list permenantly. But then again, I am just oldschool BOFH from the eighties. I say let us allow this thread to die and/or let the owners/moderators handle it as they see fit. What if the alleged spammer is friends with Rasmus Lerdorf? Would that affect your opinion? Not mine, but just something to ponder as we allow the dead [posts] to rest in peace. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php