@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25



Comments:

<0> thanx ppl =)
<1> lol ;]
<2> Drakas: basically I'm just trying to hit a switch, which will toggle a value in a database ... I just want to get it working first... then clean it up after ...
<3> right now im trying to get the delete function to work
<0> is it "safe" to convert the column to char if its int right now? or is there a major chance of b0rk ?
<1> babo: no need to use javascript there buddy :]
<3> but for some reason the code isnt working
<3> where am i going wrong at?
<4> extr3m: I believe that you can do an alter table and convert the column into a varchar, and expect the data to be maintained correctly. But do test it on a test db first of course!
<2> Drakas: yes, but I'd prefer not to have to do a full form submit ... javascript is just neater (... and cooler ) :-)
<1> extr3m: should be safe.... but your queries might not work correctly, when using > or < probably
<3> $_GET['id']; is that part pulling from the database or the variable
<1> babo: start off the dirty way ;) don't go too high at first steps. computers is starting at quiet good point, where we can teach the guy. hwoever, it's harder to teach a person who hasn't gone through basic steps.
<1> i myself dont like forms at all btu what can you doo... ;]
<3> cause the database autonumber im trying to pull from is called pk
<3> <---needs teaching, lol



<3> im trying to learn backwards which i seem to learn quicker
<2> Drakas: hmmm ... but I think I've 'mastered' the 'art' of the form .... I want to learn how to do it another way. I think I've got it though ... I mean the problem is fairly simple. I just didn't have the right tools. I've found that firebug extension is just what I need to debug the htmlrequest ... I'll try it out and see if I can get it running
<1> if you have a look at http://groups.google.com/group/SiteDesign/browse_thread/thread/dbee048242ec3a0d/# , you would see an example of a person who doesn't know what he/she's doing - ASP vs. HTML ?=DD
<1> babo: right :]
<3> drakas, any ideas on my problem?
<2> Drakas: I do appreciate your advice though ... thank you :-)
<3> or anyone that is available
<3> http://pastebin.com/623248 line 170-182
<3> trying to delete an agent file, or make that button
<4> computers: $_GET['id'] is retrieving the ID from the query string, such as blah.php?id=42
<3> ah ok
<5> if(@$sql) <-- WTH?
<1> lol =DD
<4> computers: It is a very bad idea to use a GET request to delete things (or make any other modifications), because some web browsers automatically fetch linked documents even if the user doesn't click them
<3> this is part of an administration panel
<3> that you have to log into
<1> computers: as continuing MarkR 's question: an example of a spider bot =]
<1> * answer
<3> but the require file at the top makes sure the person is logged in first
<4> Even if it's a page that a spider bot can't get to (for example, authentication required), a web browser could still legitimately fetch a linked page
<3> it would come up invalid, because they are not logged in though
<3> actually just take them to the login page
<4> No, because they would be logged in, because they would have any cookies that were relevant already
<3> you are talking about a spider doing this?
<4> No, an auto-preloader in a browser
<4> Not an autonomous bot like googlebot
<3> ok, but i never heard of an auto-preloader
<3> what is that?
<4> Well, they exist
<3> how do you defend against such things?
<4> I don't really know what they're called, probably companies market them as web "accelerators" etc, they prefetch pages linked, based on what they think the user will click on
<1> for example, MarkR ?
<4> I believe that Google actually have one, maybe it's called google web accelerator
<1> =)
<4> Anyway, you can avoid it by only using POSTs to make changes
<1> i would really make a post form for deleting things
<3> hrm, well then if that was the case, almost any php site could be hacked then
<4> The easiest way is to have a radio button, then a conventional submit button
<3> ok, well say you have a profile up, as in this case
<3> ok, well that can be done, instead of a link right?
<4> computers: It can't happen unless the user visits the previous page. It doesn't happen autonomously, but it might happen if the user hasn't physically clicked the ilnk
<4> Use radio buttons or check boxes, then have a button "delete selected items" which deletes them
<4> Another (really lame) technique is to have one form per item
<4> It would be nice if you could have one submit button per item, which is possible,
<3> ok markr, well can u help me straighten out that section of the code, with just a button that says, delete this agent
<4> but due to a bug in MSIE, you can't do <button name="delete" value="42">Delete item 42</button>
<3> err, dammit
<1> o^O
<3> thats the wrong php page also, i can tell im still not awake
<1> why is IE stoping the whole world's developement!
<3> lol
<4> Drakas: MSIE makes it very difficult to generate a button whose label and submit value are different,
<4> Normally you won't want your delete button labelled with the id of the item to delete
<1> -right what a biatch
<1> ;}
<4> However, MSIE just ignores the W3C HTML spec definition of <button> and does its own thing, which is infinitely less useful.
<3> i wondered why the code wasnt looking the same for the delete function
<3> http://pastebin.com/623272
<3> line 77-90
<3> that isnt deleting the agent
<4> computers: There are so many things wrong with your code, I don't know where to begin



<3> for some reason
<3> lol, thats re***uring
<3> damn, i thought i was doing good
<4> Structurally, the page is a mess. You should not place the code to delete something in the middle of a while loop.
<3> its not
<4> Normally I'd say, the structure of a PHP page should be: 1. Include standard functions etc, 2. Decide what to do, calling the appropriate functions, which carry out validation as necessary, 3. output the results.
<4> If you mix up these three activities, it becomes very confusing
<3> the while loop ends on line 70
<4> computers: You're right it does. However, my point stands
<4> If you're going to do any updates / deletes/ inserts, do them FIRST before you display any HTML
<3> so the function should be close to the first thing
<4> Then if an error occurs you can handle it better, also, the output will reflect the modification
<3> so can you see what im doing wrong between line 77-90?
<1> sweet lord..
<4> Yes, many things
<3> {ears opened}
<3> {eyes peeled to screen}
<3> ?
<3> mark or drakas, can you give me a bit better explanation than many things please?
<3> for line 77-90
<4> common: 1. You're using GET for a delete 2. "$agentID = $agentRows['pk'];" doesn't appear to do anything. 3. if(@$sql) makes absolutely no sense. 4. echo mysql_error is syntactically not a valid way of doing this 5. You're not actually putting the ID you want to delete into the query
<4> points 6-99 i can't be arsed to find any more errors in lines 77-90
<6> I'm trying to match things in a HTML-code using: preg_match('/1. <a onmousedown="track(.*?)<td colspan=3>/s', file_get_contents('foo'), $matches); How can I make the match stop at the first match? because now it starts at "11. <a onmouseover..." instead of "1. <a onmouseover"...
<3> k mark, let me make some adjustments in the code
<4> computers: I think you should start again, and make a very, very simple page. Break it down into more pieces, and make them clearer
<4> It's obvious that you've been hacking this around for quite a while, there's heaps of dead/nonworking code in it. Start again with something clean and simple
<1> computers: get smarty http://smarty.php.net/ to speed up the work...
<3> well that would be easier said then done, since im not advanced in php programming
<1> it will also help you learn how to separate better..
<3> drakas, im using smarty on the main part
<1> that's an achievement!
<1> use it on both..
<7> hi, i got a curios problem, it returns: unexpected T_STRING in ... on line 29, but line 29 is a comment? if i remove the comment, it complains about line 31 which is a line, i use in other scripts and have only copied? heres my little code: http://rafb.net/paste/results/dmDsB196.html
<1> hyksos: $query = "INSERT INTO go_name(firmenname, vorname, nachname) values($firmenname, $vorname, $nachname);
<5> !+parse errors
<1> does that look correct?
<5> !+parse error
<8> Parse errors show the line where parsing failed, not nessicarily where you made your mistake. Try looking a line or two above the reported error.
<1> hyksos: $query = "INSERT INTO go_name(firmenname, vorname, nachname) values($firmenname, $vorname, $nachname);"; maybe..
<3> http://pastebin.com/623299
<3> look better?
<7> ohhh, thanks
<5> Drakas: o.O
<1> hyksos: what editor are you using to write code?
<3> i rewrote that part
<9> syntax highlighting going weird is your friend with string-related errors.
<7> Drakas :vim
<1> hyksos: get bluefish =]
<1> it's a really better thing than vim
<7> Drakas :ok, i will look
<7> Drakas :what features a very good :)
<1> bluefish has got good syntax highlighting and tabs
<1> computers: did you listen to what MarkR said?:)
<3> wait 1 other thing
<3> i forgot about the sql statement
<3> about using post instead of get?
<1> yes!
<1> but you post using a form...
<1> wtf, x crtached
<10> computers: it's -> WHERE pk = '{$agentID}'");
<3> thanks stark
<1> Dark_Fire: NO
<1> !guidelines
<11> hu ?
<1> !tell Dark_Fire about g7
<11> wtf
<1> "advertisements or onjoin/away/back messages.)" <<?
<11> wawit
<11> !tell Dark_Fire about g7
<11> whateva
<11> this sux


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #php
or
Go to some related logs:

consistent api pragmatic programmers
ubuntu install cpkg
#gentoo
#sdl
lookbehind assertion ruby
eval: variable L has no value
ided xorg
subtract two arrays perl
mysql allow empty values NULL
#osdev



Home  |  disclaimer  |  contact  |  submit quotes