IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-10-24 20:19:38
Channels: 41
Logged Lines: 6230436
Size: 1982.48 MB
Powered by
Channel Info
Network: freenodeChannel: #php |
Search in www.irclog.org
Log from #php at freenode 2006-06-20
Pages: < Prev
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Next >
[05:39]<zdzxzzmfdgzx>+samuel: ob_start(); include('generator.php'); $data = ob_get_contents(); ob_end_clean(); //do something with $data
[05:43]<auzuz>-I have two pages. 1=form the 2nd=submit php code. I have it worked right now where when they hit submit it brings up the submit code page after it submits it to my db. How can i make it so they cannot see this page, and stay where they were on my site?
[05:43]<srdunf>+diogo86, yes! i still cant figure it out!
[05:43]<myjrjo7>-samuel, richardlynch gave another way for doing it. seems to be much better.
[05:44]<jjnx>-richardlynch ok, i will do that
[05:44]<axnnzyjs>+hello all
[05:44]<axnnzyjs>+I'll trying to populate a javascript variable with an html string
[05:44]<axnnzyjs>+*I'm
[05:44]<zdzxzzmfdgzx>+Augur: Your page HAS to do the POST for the form to submit. You can spit out whatever you want after that, including, if you want, doing an include() to show them the same thing they just saw... Though it's probably a Bad Idea. (tm)
[05:45]<axnnzyjs>+I've tried htmlentities to no avail
[05:45]<axnnzyjs>+does anyone have any suggestions?
[05:45]<zdzxzzmfdgzx>+cheerios: Javascript is not HTML. I suspect you will find solutions in the User Contributed notes for htmlentities, however...
[05:46]<axnnzyjs>+richardlynch: I know, but i have an html string that I wish to pass through javascript into an HTTPRequest
[05:46]<srdunf>+richardlynch, thanks!!! it works!!!
[05:47]<zdzxzzmfdgzx>+cheerios: You need to do htmlentities on it first, propbably, and then some kind of javascript escape. I think there is a JSON in pecl or pear that will do javascript escape... I never use JS, so don't really know.
[05:47]<axnnzyjs>+thanks richardlynch
[05:48]<jjnx>-well richardlynch the mysql_error show nothing :(
[05:49]<zdzxzzmfdgzx>+JoeX: pastebin your code. Something is fundamentally wrong here...
[05:49]<auzuz>-richardlynch. What i want to do is take the code from the submission php coding on the second page, and place it in the same php file as the form
[05:49]<auzuz>-how would i do this?
[05:49]<jjnx>-i already put them everywhere (after connect, after query, after select db)
[05:49]<jjnx>-ok i'll post my script
[05:49]<myjrjo7>-JoeX, so why do you think there's any mysql error?
[05:49]<zdzxzzmfdgzx>+Augur: if (isset($_POST['html_input_name'])) { /* do form submit */ } else{ /* show blank form */}
[05:50]<auzuz>-gotcha
[05:50]<auzuz>-thnx
[05:54]<vnxwrxjjf>-hi
[05:56]<vnxwrxjjf>-hi
[05:56]<jjnx>-richardlynch it's here: http://pastebin.com/720053
[05:56]<zdzxzzmfdgzx>+.
[05:56]<vnxwrxjjf>-Can someone help me please?
[05:56]<zdzxzzmfdgzx>+not if you don't say anything more than "hi" we can't.
[05:57]<vnxwrxjjf>-Wow thanks for the warm welcome. 'Hi' is a greeting. Anyways, I don't understand how sessions work. Could you explain it to me please?
[05:57]<vnc>-http://hashphp.org/pastebin.php?pid=7091
[05:58]<vnc>-I'm trying to increment the ['t'] multi-dimensional array by a value
[05:58]<vnc>-(4, 5, 6)
[05:58]<zdzxzzmfdgzx>+You do session_start() at the top of every page where you want sessions to work. You cram things into an array named $_SESSION and PHP remembers them from page to page.
[05:58]<vnc>-any number
[05:58]<vnc>-it's giving me an error
[05:59]<vnxwrxjjf>-How do I use it though? I say session_start() at the top, then how do I access it?
[05:59]<xmlxjym>-tek: what's the error?
[05:59]<zdzxzzmfdgzx>+JoeX: Just for fun, instead of the new log() and all that, could you just print the mysql_error() out?...
[05:59]<vnxwrxjjf>-ergh
[05:59]<vnc>-Notice: Undefined index: f in /var/www/html/bodyparts.php on line 15
[05:59]<zdzxzzmfdgzx>+teh1ghool: You access whatever you have already stored, if anything in $_SESSSION array like, $_SESSION['username'] might be set to their username.
[06:00]<vnxwrxjjf>-Ok...
[06:00]<eygjz`>-hrm
[06:00]<vnxwrxjjf>-thx
[06:00]<eygjz`>-anyone created a function for truncating html
[06:00]<eygjz`>-that could contain lists etc.
[06:00]<eygjz`>-but you wouldnt truncate til after the end of the list
[06:00]<eygjz`>-or the <li> at least, or something along those lines
[06:00]<xmlxjym>-tek: that's not an error.
[06:00]<eygjz`>-http://wow.nibbits.com/mods-and-addons/4976/ctmod.html
[06:00]<zdzxzzmfdgzx>+tek: There are not 15 lines in what you pastebinned... What do you want us to do?
[06:00]<eygjz`>-you can see my problem :)
[06:01]<vnc>-the other 15 are HTML
[06:01]<vnc>-I have a multi-dimensional array
[06:01]<myrrj00w0ww>+hi all - maybe you can answer my question
[06:01]<jjnx>-richardlynch ok, i'll do that
[06:01]<xmlxjym>-tek: you're incrementing a value that doesn't exist. that's a notice telling you that
[06:01]<xmlxjym>-either initialise your arrays or turn notices off. i suggest the former.
[06:02]<zdzxzzmfdgzx>+tek: Do you mean 't' instead of 'f'? Is there anything *IN* the arrays? If not, use: if (isset($object[$post_key]['t])) to decide what to do about adding $v to it, or setting it to $v
[06:02]<vnc>-Well my problem is I'm doing the foreach() to get the objects I want
[06:02]<myrrj00w0ww>+i have a folder in /www/photos/1 and /www/photos/2, i want to create 2 xml files that each have the listing of all files in the respective folders.. can this be done - i have never coded php but i am kinda competent :)
[06:02]<jjnx>-richardlynch what do you mean with new log() ?
[06:02]<vnc>-I'm building the object array, like, $object['foot']['t'] = ...
[06:02]<zdzxzzmfdgzx>+zinor`: Perhaps you want to take your HTML into http://php.net/dom and then tear it apart to decide what to snip out.
[06:03]<vnc>-then I want ti incremennet T
[06:03]<vnc>-or just foot perhaps
[06:03]<eygjz`>-i dont want to strip it
[06:03]<jjnx>-which file is it richardlynch ?
[06:03]<jjnx>-is is test.php ?
[06:03]<zdzxzzmfdgzx>+JoeX: simplify. Instead of doing the log stuff, just echo mysql_error()
[06:03]<xmlxjym>-dingo: sure, you'll just have to write some code - glob gives you all teh files in a directory, then there's lots of ways of producing xml
[06:03]<jjnx>-ok
[06:03]<xmlxjym>-tek: hello?
[06:03]<vnc>-yes?
[06:04]<xmlxjym>-did you see what I wrote?
[06:04]<myrrj00w0ww>+Xyphoid: thanks for helping - is there a ready-made script that i can use instead of trying to learn php (which could take some time)
[06:04]<dnrx>-test
[06:05]<xmlxjym>-that's not really the kind of task people distribute scripts for - it's going to be 10 lines max
[06:05]<myrrj00w0ww>+Xyphoid: so where can i start - i have never coded php, but am proficient on the java and html side of things
[06:06]<dnrx>-is there a way to change the charset of a string?
[06:06]<jjnx>-richardlynch : http://pastebin.com/720080 -> http://www.ayowisata.com/urgent5.php
[06:06]<myrrj00w0ww>+Xyphoid: any hints would be helpful - first hint on glob appreciated
[06:06]<xmlxjym>-reading the syntax I guess, you'll want to use glob() or something to read the files into an array, then decide whether you're going to throw together xml from string concatenation or use DOM to build it
[06:07]<xmlxjym>-if you can write java code, you'll know how to structure the code - it's just a matter of syntax.
[06:08]<myrrj00w0ww>+yep
[06:08]<vnc>-how can I define an array before I increment it?
[06:08]<myrrj00w0ww>+its the syntax :)
[06:08]<vnc>-likw I want to say $array['index'] + $value;
[06:08]<myrrj00w0ww>+was just windering if my lazy ass can avoid any work
[06:08]<myjrjo7>-teach, $array['index'] = 0; ?
[06:09]<zdzxzzmfdgzx>+tek: if (isset($array['index'])) $array['index'] += $value; else $array['index'] = $value;
[06:10]<mr-2y2fn>-whats the best way to grab a query string (ID) and prevent injection
[06:10]<zdzxzzmfdgzx>+da-bible: http://php.net/mysql_real_escape_string
[06:10]<myjrjo7>-richardlynch, how do you usually do it inside a loop? for( $i=0; $i<100; $i++){ $a = isset($a) ? $a . chr($i) : chr($i); } or you $a = ''; before the block?
[06:11]<zdzxzzmfdgzx>+da-bible: If you KNOW $_GET['ID'] is going to be an int, do: $ID = (int) $_GET['ID'];
[06:11]<zdzxzzmfdgzx>+diogo: If I know for sure what's going to be IN the array, I initialize 'em all. If I don't know, I initialize 'em as I go.







