Re: [PHP] Linux Question
Lets see where to start. Ive used both the px, pixels, and the small and tested them both in Linux (Mandrake 9.0) using Mozilla. Galeon and Opera, using default settings they come with, and they zoom the text with no problems. On windows Ive tested the same stuff using IE and Netscape, using default settings they both come with, and they all zoom to large and smaller sizes no prob. Im not really looking for a style sheet switcher, just needed a couple fonts to use. Im currently using helvetica, verdana, sans-serif, arial. Which looks really good in windows, but in Linux the letters look small and bold like. If I use the zoom options then the fonts look ok. So do yout think If I make the fonts larger by default in the style sheet it would be ok on most browsers in Linux ? Thaks for all the replies, Lee "Justin French" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... on 26/11/02 11:04 AM, Brian V Bonini ([EMAIL PROTECTED]) wrote: > On Mon, 2002-11-25 at 18:26, Justin French wrote: >> on 26/11/02 2:41 AM, Brian V Bonini ([EMAIL PROTECTED]) wrote: >> >>> Also, try to use relative sizes, if you use fixed sized like 10pt. you >>> will have size discrepancies on different platforms. If you use a >>> relative scheme like 12px it will render more consistently >> >> 12px is NOT a relative size, and will mean that users with vision >> impairment, etc etc will have trouble resizing the text to suit their >> preferences... The relative sizes are things like "small". >> >> http://www.w3.org/TR/CSS2/fonts.html#propdef-font-size > > px is obviously a relative unit (relative to the users screen) unless > your going to try to say everyone views stuff at the same dpi. It's late > so perhaps I'm missing it but I do not see anywhere in the spec that you > cited where it says px is absolute. However I will quote loosely from > the spec: "values with relative units (em, ex, px) must be made absolute > by multiplying with the appropriate font or pixel size," > > So, go ahead and try what I suggested THEN tell me it's not right. Using > px WILL make it more consistent across win, linux, mac, etc.. and will > not inhibit the browsers ability to enlarge the text size at all... I don't think I was being clear enough at all :) 12px is 12pixels... there is no way for it to *reliably* be reset to 14px, or 10px by the user on all browser. In the current versions of IE for Win, using the text size larger smaller or % options in the menus has no effect whatsoever if values like 12px or 12pt are given. If you specify 12px, and I decide I need it bigger, I don't have many options, other than totally overwriting your style sheet with my own (no thanks!, and beyond most web users). The good news is that because 12pt and 12px are so prolific on the web (and so evil in terms of accessability), browser manufacturers are now beginning to make px and pt variable sizes as well. That is to say, in IE5 Mac, NN7 (and maybe 6), and some other browsers DO LET YOU CHANGE THE FONT SIZE FRONT THE MENUS, selecting smaller, larger, 120%, or whatever. The bad news is that the latest versions of IE6 (at least 3 months back when I did some major CSS testing) did not let users do this. It's well documented, and people like Zeldman and A List Apart have spent months campaigning for IE Win to match IE Mac and NN on this. Here's a snippet from http://www.zeldman.com/daily/0702b.html > To satisfy the demands of accessibility within the context of normative > practices in commercial web design, IE/Win needs to do what IE/Mac did in > March, 2000: implement Text Zoom, so visitors can resize any web text. Will > Microsoft ever make this change to IE/Win? We can only hope. And this one from http://www.zeldman.com/daily/0502c.html > Pixels solve these problems by delivering a guaranteed base size. But what if > that base size is too small for some readers? > Opera has always offered its users the ability to easily scale any web > page via Page Zoom. In January 2000, WaSPs Todd Fahrner and yours truly > persuaded the appropriate engineers to add a similar feature (³Text Zoom²) to > IE5/Mac and Mozilla/Netscape 6. Thus nearly all current browsers allow users > to resize text set in pixels. If text is too small, hit a button, a command > key combination, or a drop-down menu, and voila! Instant legibility. > Alas, MSIE for Windows does not allow web users to resize text set in > pixels. We will keep pestering Microsoft to add that feature to its Windows > browser. Until they do, alternate style sheet widgets enable designers to work > around this thorny accessibility problem. So, I stand partially corrected, the user CAN override ALL font size by digging into the accessibility menus, but I seriously doubt many do. If the latest versions of IE *DO* allow text zooming via the menus, again I stand corrected, but there are millions of web users out there on IE5 and IE6 without text zoom. IMO, specifying a px or pt font size
[PHP] Re: session problems
Hey Also in your php.ini do you have session.use_cookies = 1 if its set to 0 then you will need to pass the variables through the URL. - Lee "Jason Romero" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > when using session registered variables > i can only get them to save as session variables for one page > then on the next page they are gone > far as i can tell the variables are not getting written over or unset > and the session is not gettting destroyed > any other ideas what it might be? > > Jason > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: session problems
Hey again. In the php.ini if register_globals = Off - which is the default setting then you will need to use $_SESSION['variable'] - Lee "Jason Romero" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > when using session registered variables > i can only get them to save as session variables for one page > then on the next page they are gone > far as i can tell the variables are not getting written over or unset > and the session is not gettting destroyed > any other ideas what it might be? > > Jason > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] md5 question
Hey. Is there a way to get the actual word/phrase from the long string that the md5 hash creates. Lets say, is there a way find out what b9f6f788d4a1f33a53b2de5d20c338ac stands for in actuall words ? Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Just Curious
I was just curious, but what program or website do you all use to view and reply to the newsgroups with ? Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Building apache, php & mysql, should I use apache 2.0?
Hey, I've been using Apache 2.0.43, PHP, MySQL on Linux machine. Ive been using for a production site that gets good traffic but nothing real major. Has multi threading so the speed is really nice. Apache 2 and PHP are still experimental at the time. However, I havn't ran into any difficulties with it yet. I think the new Apache 2 is a little easier to config too. Hope some of this helps. - Lee - Web & Graphic Design Using Open Source Technologies "Buddy Lumpkin" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi All, Haven't build apache and php for a while now and im just wondering if I should build apache 2.0 or 1.3? Is php under apache 2.0 still experimental? What are the pros/cons? Thanks in advance, --Buddy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Smarty + css + dreamweaver
Daniel Masson wrote: Hi list : This is maybe a silly question from deamweaver users, i hope you people understand what i mean. im working on a site php, smarty,css , etc. the directory structure of the site is this: -- - classes - Files of the smarty class - Templates (Directory) - template1.html - template2.html - template3.html - dw_template.dwt script1.php script2.php script3.php style.css javasc.js -- script1.php, script2.php, and script3.php look like this Require "/path/to/smarty/smartyfile.class.php"; $page = new Smarty; // some stuff $page->display("templateN.html"); //end Im working dreamweaver Templates system so every templateN.html are attached to dw_template.dwt, dw_template.dwt calls the style sheet like this: Of course all the templatesN.html call the style shett the same way. No problem here. But ... since scriptsN.php need the TemplatesN.html ... (maybe im wrong with this) the browser doesnt know that Templates/TemplatesN.html exist, the browser calls http://site/script1.php http://site/script2.php So the browser shouldnt find the style sheet because TemplatesN.html call ../style.css and ../style.css doesnt exists relative to http://site/scriptN.php , and for my surprise the output result DOES apply the style sheet ... Am i wrong with this ??? Or what should i know about all this ?? Thanks for reading this long and silly question. Daniel. Hey, Say your sytle sheets are in the directory called test but your html files are in test/pages you could simply put this in your html files type="text/css"> the 2 periods tell the browser to look one directory back for the file called style.css. Hope that helps. -- conbud Graphic & Web Design Using Open Source Technology -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Strange problem with PHP,SSI
Sport4ever wrote: PHP version: 4.2.1 OS: RedHat Linux 8 Apache version: 2.0 My problem is that I can't execute more than one (SSI include) on my website JUST for PHP file.. so there is NO problems at all if I include HTML or SHTML files. Anyway, if I include 2 PHP files into any page, the first INCLUDE statement would execute correctly and print out the file output, but the second INCLUDE statement would NOT execute, and instead, the statement printed in the page source as it is: notice that this problem was not exist in my server before I upgrade PHP from 4.1.2 to 4.2.1 and Apache from 1.3 to 2.0 and Linux from 7.3 to 8.0 !! any idea? Hey, you could try using the PHP include or -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Session: I RTFM
John Taylor-Johnston wrote: Jason wrote: RTFM again. Jason, again, I RTFM, but did not get it working. Otherwise I wouldn't have dared ask a question. Sessions depends on a number of factors including your version of PHP and the setting of register_globals. The FM manual says: "$_SESSION (or $HTTP_SESSION_VARS with PHP 4.0.6 or less) is recommended" So I am using "PHP Version 4.1.2" (and "4.2.3" on my localhost to test offline) Ok. I quit using $HTTP_POST_VARS["familyname"]. With a little rethinking, I have this working, I hope. Now ... is there a cleaner way to assign my variable "familyname"? Pseudo code: if _post["familyname"] exists set session variable (no sense in setting it until I post it) if _session["familyname"] exists, $familyname = $_SESSION["familyname"]; I'll have about 30 variables. Going to be alot of lines. There must be an easier, cleaner way? "; } if (isset($_SESSION["familyname"])) { $familyname = $_SESSION["familyname"]; echo "yay session works, \$familyname= $familyname"; } Hey, I dont know how much easier it will be but it is faster, you could use a switch statement. switch ($_SESSION['familyname']) { case 'name1': do something; break; case 'name2': do something; break; default: do this if the variable doesnt match a case; break; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Alternating Links
Hi. Lets says I have 8 links stored in a database, extracting those links is no problem. Now lets says I have 2 columns, how do I get link 1 into column 1 then get link 2 into column 2 then link 3 into column 1 and link 4 into column 2 and so on... This is column 1 This is column 2 -- Conbud Graphic & Web Design Using Open Source Technology -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Alternating Links
Hey, thanks. I should have thought about it longer, since I made something the exact same to alternate bgcolors. Thanks for refreshing though. Justin French wrote: There was a post on a similar thing the other day, and about once a week for the past few years :P Quick (untested) example: $i = 0; $sql = 'select link from tablename'; $result = mysql_query($sql); while($myrow = mysql_fetch_array($result)) { $i++; if($i == 1) { echo ''; } echo "{$myrow['link']}"; if($i == 2) { echo ''; $i = 0; } } ?> This is easily adaptable to three (or more) columns by changing the last if() statement... Justin on 20/12/02 5:21 PM, conbud ([EMAIL PROTECTED]) wrote: Hi. Lets says I have 8 links stored in a database, extracting those links is no problem. Now lets says I have 2 columns, how do I get link 1 into column 1 then get link 2 into column 2 then link 3 into column 1 and link 4 into column 2 and so on... This is column 1 This is column 2 -- Conbud Graphic & Web Design Using Open Source Technology -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Message Board Question
Hi, this is kind of a complex question, Im making a message board, now I dont want list, lets say, all 25 messages on the same page. I would like to have <- previous 1 2 3 next -> type of links and only list 5 messages per page and every time a user clicks the next, previous, or one of the page number links it will list the next 5 messages that havn't been listed yet. Could someone show me how to do this or at least point me in the correct direction ? The data is all stored in a MySQL database. Thanks, -- Conbud <[EMAIL PROTECTED]> Graphic & Web Design Using Open Source Technology -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Message Board Question
Hey thanks everyone, I pretty much got it working now. Conbud wrote: Hi, this is kind of a complex question, Im making a message board, now I dont want list, lets say, all 25 messages on the same page. I would like to have <- previous 1 2 3 next -> type of links and only list 5 messages per page and every time a user clicks the next, previous, or one of the page number links it will list the next 5 messages that havn't been listed yet. Could someone show me how to do this or at least point me in the correct direction ? The data is all stored in a MySQL database. Thanks, -- Conbud <[EMAIL PROTECTED]> Graphic & Web Design Using Open Source Technology -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Pagination Part 2
Hi, Ive been trying to get this to work but I keep getting this error Parse error: parse error, unexpected $ in /home/conbud/nrlug/test3.php on line 72 line 72 is just the ending php bracket, heres what I got: @mysql_connect(localhost, root, boing_boing) or die("ERROR--CAN'T CONNECT TO SERVER"); @mysql_select_db("nrlug") or die("ERROR--CAN'T CONNECT TO DB"); $limit= 2; $query_count= "SELECT lnkname FROM links"; $result_count= mysql_query($query_count); $totalrows= mysql_num_rows($result_count); if(empty($page)) $page = 1; $limitvalue = $page * $limit - ($limit); $query = "SELECT * FROM links LIMIT $limitvalue, $limit"; $result= mysql_query($query) or die("Error: " . mysql_error()); if(mysql_num_rows($result) == 0) echo("Nothing to Display!"); $bgcolor = "#E0E0E0"; // light gray echo(""); while($row = mysql_fetch_array($result)){ if($bgcolor == "#E0E0E0") $bgcolor = "#FF"; else $bgcolor = "#E0E0E0"; echo("\n"); echo($row['lnkname']); echo("\n\"); echo($row['id']); echo("\n"); } echo(""); if($page != '1'){ $pageprev = $page--; echo("PREV "); }else echo("PREV "); $numofpages = $totalrows / $limit; for($i = '1'; $i <= $numofpages; $i++){ if($i == $page) echo($i." "); else echo("$i "); if(($totalrows % $limit) != '0'){ if($i == $page) echo($i." "); else echo("$i "); if(($totalrows - ($limit * $page)) > '0'){ $pagenext = $page++; echo("NEXT"); }else echo(" NEXT ".$limit); mysql_free_result($result); ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Listing a few words from one sentence ??
Say I have a sentence that contains 8 words, how do I get PHP to list just 4 of those 8 words ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache 2 and PHP
Hi, I use Apache 2.0.4 and PHP 4.2.3 on Mandrake Linux and Win XP. On Linux its been extremely stable and havnt had a single problem yet, on XP I have a few minor problems to where the PHP was executing slow but nothing majorly noticable. "Davy Obdam" <[EMAIL PROTECTED]> wrote in message news:01c286ad$128c1630$960a@;hewlett0bg96om... > Hi Kirk,. > > I run apache 2.0.40 and PHP 4.2.3 without no problem on my windows XP > machine. I use it for testing, but i would think its stable enough for a > production environment aswell. I actualy think that on a win32 platform > Apache 2 is a better choice instead of 1.3.x. Whats your opinion about > this? > > Best regards, > > Davy Obdam > mailto:info@;davyobdam.com > > > > -Oorspronkelijk bericht- > > Van: Johnson, Kirk [mailto:kjohnson@;zootweb.com] > > Verzonden: donderdag 7 november 2002 16:26 > > Aan: [EMAIL PROTECTED] > > Onderwerp: [PHP] Apache 2 and PHP > > > > > > Last I heard, PHP and Apache 2 were not yet ready for > > production environments. Are there any further updates? > > > > What is the best way to keep up on the status of this? Any > > good sites in particular? > > > > TIA > > > > Kirk > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > Deze e-mail is door E-mail VirusScanner van Planet Internet > > gecontroleerd op virussen. Op http://www.planet.nl/evs staat > > een verwijzing naar de actuele lijst waar op wordt gecontroleerd. > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Listing a few words from one sentence ??
Hey I guess I sort of worded my question wrong, if the sentance says Thank you for helping me with PHP I wanna be able to just have the first four words of the sentence printed so it says Thank you for helping... ".: B I G D O G :." <[EMAIL PROTECTED]> wrote in message news:1036685027.13268.108.camel@;pclnxrhunter.digitalglobe.com... > perl regex to find the ones you want and then print them out... > > or you could explode then string and put each word in to one array and > access the word by the array index... > > Example: > > $words = explode( " ", $sentence ); > > for( $i = 0; $i < 4; $i++ ) > { > echo "{$words[$i]}"; > } > > > > On Thu, 2002-11-07 at 22:29, conbud wrote: > > Say I have a sentence that contains 8 words, how do I get PHP to list just 4 > > of those 8 words ? > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > -- > .: B i g D o g :. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Notice problem...
Hey Use error_reporting = E_ALL & ~E_NOTICE that will display all errors except notices, I use if statements in a lot of my pages and if one of the variables in the if statement doesnt get defined, which some of them are ment to not get defined if a certain other variable is already define, so you may have all of your PHP syntax ok but still getting the notice. Hope this helps. - Lee "R B" <[EMAIL PROTECTED]> wrote in message news:F71fyz5b6KZmcK8r6be0044@;hotmail.com... > When i set display_errors = On and error_reporting = E_ALL in my php.ini, > i get the next message for each variable that i use in the script: > "Notice: Use of undefined constant varname ." > > How is the best solution for this problem, setting error_reporting = E_ALL > & ~E_NOTICE or other method? > > Thanks, > > RB > > > > > _ > Charla con tus amigos en línea mediante MSN Messenger: > http://messenger.microsoft.com/es > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP not working in html
Hey there check out this URL http://www.php.net/manual/en/installation.php -Lee "Mike At Spy" <[EMAIL PROTECTED]> wrote in message news:GKEFLEHIPEGIFEECKBNEAEHCGMAA.spycobalt@;spyproductions.com... > > PHP isn't working in my html docs - what changes do I need to make to get it > to do so? Does it need to be recompiled? Can I do it without re-compiling? > > Thanks, > > -Mike > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] W3C and PHP
Hi, In some of my URLs I have to pass variables through the URL like nav.php?page=about§ion=linux - when i do this and then scan my site for W3C validation I get this Line 40, column 28: ... http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: W3C and PHP
Hey I did what both of you all said to do href="nav.php?page=about§ion=Linux" and my arg_separator.output is ok but Im stilling getting that same error with W3C, my page is executing ok and was before, but I cant get it W3C HTML 4.01 valid with that error. -Lee "Conbud" <[EMAIL PROTECTED]> wrote in message news:20021109061217.3242.qmail@;pb1.pair.com... > Hi, > In some of my URLs I have to pass variables through the URL like > nav.php?page=about§ion=linux - when i do this and then scan my site for > W3C validation I get this > Line 40, column 28: > ... > How could I acomplish the same results and not trigger an error with W3C, > is there a way to do it with out having to start sessions on every hit to > that page ? > > -Lee > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Function Problem
Hey Im trying to create a fucntion in an include file function db_conn($host,$user,$pass,$dab) { $db = mysql_connect("$host", "$user","$pass")mysql_select_db("$dab",$db); } In the page ide use: require('func.inc.php'); db_conn("$host","$user","$pass","$dab"); $result = mysql_query("select * FROM $page",$db); $myrow = mysql_fetch_array($result); echo $myrow['general_info']; ... ... however when I use the db_conn on the webpage I just get a mysql error saying not a valid resource, so how do I get the db_conn to actually return the data, ive tried using function db_conn($host,$user,$pass,$db) { $db = mysql_connect("$host", "$user","$pass")mysql_select_db("$db",$db); return $db } and various other thing but still nothing, I have to actually put the echo statements in the function too to get it to work properlly, any ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Function Problem
Hey, Of course they do, they work if I put the echo in the function its self, but I dont need the echo in the function. - Lee "Marco Tabini" <[EMAIL PROTECTED]> wrote in message news:1036911387.23753.1054.camel@;localhost.localdomain... > Either add > > global $db; > > as the first line of the function or change your function call to: > > $db = db_conn("$host","$user","$pass","$dab"); > > I assume that $host, $user, $pass and $dab actually contain some correct > values. > > > Marco > -- > > php|architect - The magazine for PHP Professionals > The first monthly worldwide magazine dedicated to PHP programmers > Check us out on the web at http://www.phparch.com > > > > On Sun, 2002-11-10 at 01:58, conbud wrote: > > Hey > > Im trying to create a fucntion in an include file > > function db_conn($host,$user,$pass,$dab) > > { > > $db = mysql_connect("$host", "$user","$pass")mysql_select_db("$dab",$db); > > } > > > > > > In the page ide use: > > require('func.inc.php'); > > db_conn("$host","$user","$pass","$dab"); > > $result = mysql_query("select * FROM $page",$db); > > $myrow = mysql_fetch_array($result); > > > > echo $myrow['general_info']; > > > > ... > > ... > > however when I use the db_conn on the webpage I just get a mysql error > > saying not a valid resource, so how do I get the db_conn to actually return > > the data, ive tried using > > > > function db_conn($host,$user,$pass,$db) > > { > > $db = mysql_connect("$host", "$user","$pass")mysql_select_db("$db",$db); > > > > return $db > > } > > > > and various other thing but still nothing, I have to actually put the echo > > statements in the function too to get it to work properlly, any ideas? > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Function Problem
also I have the function wrong in my original question I have it as function db_conn($host,$user,$pass,$dab) { $db = mysql_connect("$host", "$user","$pass" mysql_select_db("$dab",$db); } and not function db_conn($host,$user,$pass,$dab) { $db = mysql_connect("$host", "$user","$pass")mysql_select_db("$dab",$db); } "Conbud" <[EMAIL PROTECTED]> wrote in message news:20021110065837.99825.qmail@;pb1.pair.com... > Hey > Im trying to create a fucntion in an include file > function db_conn($host,$user,$pass,$dab) > { > $db = mysql_connect("$host", "$user","$pass")mysql_select_db("$dab",$db); > } > > > In the page ide use: > require('func.inc.php'); > db_conn("$host","$user","$pass","$dab"); > $result = mysql_query("select * FROM $page",$db); > $myrow = mysql_fetch_array($result); > > echo $myrow['general_info']; > > ... > ... > however when I use the db_conn on the webpage I just get a mysql error > saying not a valid resource, so how do I get the db_conn to actually return > the data, ive tried using > > function db_conn($host,$user,$pass,$db) > { > $db = mysql_connect("$host", "$user","$pass")mysql_select_db("$db",$db); > > return $db > } > > and various other thing but still nothing, I have to actually put the echo > statements in the function too to get it to work properlly, any ideas? > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Function Problem
huh I thought I tried that befoer and it didnt work but this time it worked good, thanks everyone. Also whats the difference between $globals['$variable'] and just global -Lee "Maxim Maletsky" <[EMAIL PROTECTED]> wrote in message news:20021110082455.7C29.MAXIM@;php.net... > > you need to return $db: > > function db_conn($host,$user,$pass,$dab) > { > $db = mysql_connect("$host", "$user","$pass" > mysql_select_db("$dab",$db); > return $db; > } > > and then use $db = db_conn(,,,); > > or make it global: > > > function db_conn($host,$user,$pass,$dab) > { > blobal $db; > $db = mysql_connect("$host", "$user","$pass" > mysql_select_db("$dab",$db); > } > > -- > Maxim Maletsky > [EMAIL PROTECTED] > > > On Sun, 10 Nov 2002 02:16:14 -0500 "conbud" <[EMAIL PROTECTED]> wrote: > > > also I have the function wrong in my original question I have it as > > function db_conn($host,$user,$pass,$dab) > > { > > $db = mysql_connect("$host", "$user","$pass" > > mysql_select_db("$dab",$db); > > } > > > > and not > > function db_conn($host,$user,$pass,$dab) > > { > > $db = mysql_connect("$host", "$user","$pass")mysql_select_db("$dab",$db); > > } > > > > > > "Conbud" <[EMAIL PROTECTED]> wrote in message > > news:20021110065837.99825.qmail@;pb1.pair.com... > > > Hey > > > Im trying to create a fucntion in an include file > > > function db_conn($host,$user,$pass,$dab) > > > { > > > $db = mysql_connect("$host", "$user","$pass")mysql_select_db("$dab",$db); > > > } > > > > > > > > > In the page ide use: > > > require('func.inc.php'); > > > db_conn("$host","$user","$pass","$dab"); > > > $result = mysql_query("select * FROM $page",$db); > > > $myrow = mysql_fetch_array($result); > > > > > > echo $myrow['general_info']; > > > > > > ... > > > ... > > > however when I use the db_conn on the webpage I just get a mysql error > > > saying not a valid resource, so how do I get the db_conn to actually > > return > > > the data, ive tried using > > > > > > function db_conn($host,$user,$pass,$db) > > > { > > > $db = mysql_connect("$host", "$user","$pass")mysql_select_db("$db",$db); > > > > > > return $db > > > } > > > > > > and various other thing but still nothing, I have to actually put the echo > > > statements in the function too to get it to work properlly, any ideas? > > > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help w/ $_SESSION
Hey, How would I insert $_SESSION['user'] and $_SESSION['pass'] into this mysql_query("select count(*) AS numfound from admins where user='$user' AND pass='$pass'",$db); right now I have $_SESSION['user'] = $_POST['user'] $_SESSION['pass'] = $_POST['pass'] and I need to put $_SESSION['user'] where the $user is in the above statement and so one w/ $pass Thanks Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help w/ $_SESSION
Hey, I do have it in a variable but I just choose to leave it out. Ive tried so many different things with this and even what you gave me for some reason didnt work. The variables are being set, if I echo $_SESSION['user'] then right data is shown. However as soon as I put it in the mysql_query it stops working. Im using it for a login script that I include at the start of every page. Heres what I got: I include that at the top of every page I want to protect. Lee "Jason Wong" <[EMAIL PROTECTED]> wrote in message news:200211121537.49604.php-general@;gremlins.com.hk... > On Tuesday 12 November 2002 15:05, conbud wrote: > > Hey, > > How would I insert $_SESSION['user'] and $_SESSION['pass'] > > > > into this > > mysql_query("select count(*) AS numfound from admins where user='$user' AND > > pass='$pass'",$db); > > > > right now I have > > $_SESSION['user'] = $_POST['user'] > > $_SESSION['pass'] = $_POST['pass'] > > > > and I need to put $_SESSION['user'] where the $user is in the above > > statement and so one w/ $pass > > You mean like this? > > mysql_query("select count(*) AS numfound from admins where > user='{$_SESSION['user']}' AND > pass='{$_SESSION['pass']}'",$db); > > BTW, it is much better to assign your query to a variable, eg $qry, then do > > mysql_query($qry, $db) or die('Error in $qry ' . mysql_error()); > > That way if your query doesn't work you'll at least know why. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > Perhaps the biggest disappointments were the ones you expected anyway. > */ > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help w/ $_SESSION
Also the echo statement is just there for testing purposes to make sure the variable were containing the correct data. Lee "Conbud" <[EMAIL PROTECTED]> wrote in message news:20021112075942.16291.qmail@;pb1.pair.com... > Hey, > I do have it in a variable but I just choose to leave it out. > Ive tried so many different things with this and even what you gave me for > some reason didnt work. The variables are being set, if I echo > $_SESSION['user'] then right data is shown. However as soon as I put it in > the mysql_query it stops working. Im using it for a login script that I > include at the start of every page. Heres what I got: > > session_start(); > ?> > $_SESSION['user'] = $_POST['user']; > $_SESSION['pass'] = $_POST['pass']; > ?> > $db = mysql_connect("$host", "user", "pass"); > mysql_select_db("$dtb",$db); > $result = mysql_query("select count(*) AS numfound from admins where > user='{$_SESSION['user']}' AND > pass='{$_SESSION['pass']}'",$db); > echo "".$_SESSION['user']." ".$_SESSION['pass'].""; > > $result_ar = mysql_fetch_array($result); > if ($result_ar['numfound'] < 1) > { > session_unset(); > session_destroy(); > include("error.php"); > exit; > } > ?> > > I include that at the top of every page I want to protect. > > Lee > > "Jason Wong" <[EMAIL PROTECTED]> wrote in message > news:200211121537.49604.php-general@;gremlins.com.hk... > > On Tuesday 12 November 2002 15:05, conbud wrote: > > > Hey, > > > How would I insert $_SESSION['user'] and $_SESSION['pass'] > > > > > > into this > > > mysql_query("select count(*) AS numfound from admins where user='$user' > AND > > > pass='$pass'",$db); > > > > > > right now I have > > > $_SESSION['user'] = $_POST['user'] > > > $_SESSION['pass'] = $_POST['pass'] > > > > > > and I need to put $_SESSION['user'] where the $user is in the above > > > statement and so one w/ $pass > > > > You mean like this? > > > > mysql_query("select count(*) AS numfound from admins where > > user='{$_SESSION['user']}' AND > > pass='{$_SESSION['pass']}'",$db); > > > > BTW, it is much better to assign your query to a variable, eg $qry, then > do > > > > mysql_query($qry, $db) or die('Error in $qry ' . mysql_error()); > > > > That way if your query doesn't work you'll at least know why. > > > > -- > > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > > Open Source Software Systems Integrators > > * Web Design & Hosting * Internet & Intranet Applications Development * > > > > /* > > Perhaps the biggest disappointments were the ones you expected anyway. > > */ > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help w/ $_SESSION
I am using session_start, im using php 4.2.3 Lee "Conbud" <[EMAIL PROTECTED]> wrote in message news:20021112075942.16291.qmail@;pb1.pair.com... > Hey, > I do have it in a variable but I just choose to leave it out. > Ive tried so many different things with this and even what you gave me for > some reason didnt work. The variables are being set, if I echo > $_SESSION['user'] then right data is shown. However as soon as I put it in > the mysql_query it stops working. Im using it for a login script that I > include at the start of every page. Heres what I got: > > session_start(); > ?> > $_SESSION['user'] = $_POST['user']; > $_SESSION['pass'] = $_POST['pass']; > ?> > $db = mysql_connect("$host", "user", "pass"); > mysql_select_db("$dtb",$db); > $result = mysql_query("select count(*) AS numfound from admins where > user='{$_SESSION['user']}' AND > pass='{$_SESSION['pass']}'",$db); > echo "".$_SESSION['user']." ".$_SESSION['pass'].""; > > $result_ar = mysql_fetch_array($result); > if ($result_ar['numfound'] < 1) > { > session_unset(); > session_destroy(); > include("error.php"); > exit; > } > ?> > > I include that at the top of every page I want to protect. > > Lee > > "Jason Wong" <[EMAIL PROTECTED]> wrote in message > news:200211121537.49604.php-general@;gremlins.com.hk... > > On Tuesday 12 November 2002 15:05, conbud wrote: > > > Hey, > > > How would I insert $_SESSION['user'] and $_SESSION['pass'] > > > > > > into this > > > mysql_query("select count(*) AS numfound from admins where user='$user' > AND > > > pass='$pass'",$db); > > > > > > right now I have > > > $_SESSION['user'] = $_POST['user'] > > > $_SESSION['pass'] = $_POST['pass'] > > > > > > and I need to put $_SESSION['user'] where the $user is in the above > > > statement and so one w/ $pass > > > > You mean like this? > > > > mysql_query("select count(*) AS numfound from admins where > > user='{$_SESSION['user']}' AND > > pass='{$_SESSION['pass']}'",$db); > > > > BTW, it is much better to assign your query to a variable, eg $qry, then > do > > > > mysql_query($qry, $db) or die('Error in $qry ' . mysql_error()); > > > > That way if your query doesn't work you'll at least know why. > > > > -- > > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > > Open Source Software Systems Integrators > > * Web Design & Hosting * Internet & Intranet Applications Development * > > > > /* > > Perhaps the biggest disappointments were the ones you expected anyway. > > */ > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Syntax Help
Whats wrong here ?? The variables are getting the correct information from the form but for some reason as soon as I put the variables into the $sql they dont post the proper data to the database, its connecting to the database ok but just not updating the data. $sql = "UPDATE updates SET member= '{$_POST['mem']}', email= '{$_POST['email']}', position= '{$_POST['pos']}', dateadded= '{$_POST['dateadded']}', descp= '{$_POST['descp']}', message= '{$_POST['message']}' where id= '{$_POST['id']}'"; $result = mysql_query($sql); Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Syntax Help
Jason thanks, I completely forgot about trying echo $sql by using that I found where it was messing up. Thanks again. Lee "Jason Wong" <[EMAIL PROTECTED]> wrote in message news:200211141725.47510.php-general@;gremlins.biz... > On Thursday 14 November 2002 17:22, conbud wrote: > > Whats wrong here ?? The variables are getting the correct information from > > the form but for some reason as soon as I put the variables into the $sql > > they dont post the proper data to the database, its connecting to the > > database ok but just not updating the data. > > > > $sql = "UPDATE updates SET member= '{$_POST['mem']}', email= > > '{$_POST['email']}', position= '{$_POST['pos']}', dateadded= > > '{$_POST['dateadded']}', descp= '{$_POST['descp']}', message= > > '{$_POST['message']}' where id= '{$_POST['id']}'"; > > > > $result = mysql_query($sql); > > Does echo($sql) look OK? > > How about echo mysql_error()? Or executing $sql in the mysql command line > interface? > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > SANTA CLAUS comes down a FIRE ESCAPE wearing bright blue LEG WARMERS > ... He scrubs the POPE with a mild soap or detergent for 15 minutes, > starring JANE FONDA!! > */ > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: session handling
Hey you may want to try in page2.php : session_start(); echo('{$_SESSION['abc']}'); Lee "Anjali Kaur" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > i want to access some variables generated in one page > in all the other pages, so i thought of using > $_SESSION. > > what i did is : > > in page1.php i do: > >$temp = 'someValue'; >session_start(); >$_SESSION['abc'] = $temp; > > > in page2.php : > > session_start(); > echo($_SESSION['abc']); > > > but i am not able to get the value of abc. > > please help me out. i went thru the documentation > online but cudnt grasp much as to where i am going > wrong. > > thank you. > anjali. > > > __ > Do you Yahoo!? > Yahoo! Web Hosting - Let the expert host your site > http://webhosting.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Forms and Sessions not working
Hi, If your register_globals is off then you will need to use $_GETand $_POST to get the data from the form. echo $_POST['Name']; Lee "Chris Jackson" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi all: > Im new to php and i have an isue. > > php4.2.3 windows 2000 advanced server > > > I create a simple form page that posts back to its self and im unable to > retreive the posted form data to display on the page. > > it seems like all my GLOBAL amd SESSION stuff isnt working. > sample code: > > > > Your Name > > > > > Im thinking that it may be a setting in the php.ini file but i dont know.. > Please help. > > Thanks. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Linux and Apache
Hi. I spent the last 3 days looking through the apache docs to figure out how to disable directory listing. I can disable the directory listing to my images folder but then all the images on the site dont work. I tried using Allow from mydomain and Allow from localhost Allow from 127.0.0.1 I even tried my machine name but it all keeps blocking the images. My site has a dynamic IP so I cant set it to the IP, however I did set it to my IP at the time and it all worked great. Is there any other way I may be able to do this, without just putting a "fake" index.php in all the directories I want to protect ? Im using Apache 2.0.43 on Mandrake 8.2 - Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Linux Question
Hey. This really isnt a PHP question. but what fonts do you reccomend using so they look decent on linux. Mainly looking for a good font that will look nice in MoZilla and Galeon. Almost all the fonts Ive used so far appear really tiny or really bold and not very good to read. -Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP/MySQL/Server not working
Hey, just a quick question, I have a form that users can fill out to join a certain group, we can then view that info from an admin page that requires logging in. When a user fills out the form I get an email letting me know that the form was submitted with the users info as well. Here recently, I've been getting that info but their info isn't being saved into the database for somereason, anyone have any idea why ? I have filled out the form at least 15-25 times using different info and everyone of them worked for me. I even filled out the form using different special characters and still with no problems, I am using stripslashes on the form data, but I don't think that could keep the info from being saved to the database, it only does this periodically. Could this be due to a slow server ? or is there some sort of special character that could conflict with my PHP or with the MySQL syntax ? I just have no clue now. Any thoughts are appreciated. Thanks ConbuD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/MySQL/Server not working
magic_quotes_gpc is on, I dont use addslashes ConbuD "Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Are the variables quoted out by php setting magic_quotes_gpc or do you > have to use addslashes in your code? > > conbud wrote: > > Hey, just a quick question, I have a form that users can fill out to join a > > certain group, we can then view that info from an admin page that requires > > logging in. When a user fills out the form I get an email letting me know > > that the form was submitted with the users info as well. Here recently, I've > > been getting that info but their info isn't being saved into the database > > for somereason, anyone have any idea why ? I have filled out the form at > > least 15-25 times using different info and everyone of them worked for me. I > > even filled out the form using different special characters and still with > > no problems, I am using stripslashes on the form data, but I don't think > > that could keep the info from being saved to the database, it only does this > > periodically. Could this be due to a slow server ? or is there some sort of > > special character that could conflict with my PHP or with the MySQL syntax ? > > I just have no clue now. Any thoughts are appreciated. > > > > Thanks > > ConbuD > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP/MySQL/Server not working
Hey, Also the webhost only allows us database direct database connection using phpMyadmin, I did notice that on the table that stores the info, it keep getting an error after someone is posting the form. The error says something about Overhead: 275 bytes, Is this just an MySQL limitation that is set by the webhost ? and this overhead you think that would keep the info from being entered into the database. To get the error to go away I have to optimize the table. ConbuD "Conbud" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hey, just a quick question, I have a form that users can fill out to join a > certain group, we can then view that info from an admin page that requires > logging in. When a user fills out the form I get an email letting me know > that the form was submitted with the users info as well. Here recently, I've > been getting that info but their info isn't being saved into the database > for somereason, anyone have any idea why ? I have filled out the form at > least 15-25 times using different info and everyone of them worked for me. I > even filled out the form using different special characters and still with > no problems, I am using stripslashes on the form data, but I don't think > that could keep the info from being saved to the database, it only does this > periodically. Could this be due to a slow server ? or is there some sort of > special character that could conflict with my PHP or with the MySQL syntax ? > I just have no clue now. Any thoughts are appreciated. > > Thanks > ConbuD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Help
Hey, Im making a site to where I can fill out a form and it adds updates to the main page, but I only want the site to display 5 updates on it, now I know how to make it only show 5 updates, but then that means when a new update is posted to the site, it just stores the old updates in the database and over time this can make the database quite large, How would I make it delete the oldest update and just add the newest update to the top of the list ? So this way I only have 5 updates stored in the database at all times. Thanks ConbuD --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.744 / Virus Database: 496 - Release Date: 8/24/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Selecting Date Range
Hey, I have a database with approx 200-300 students in it. I wanna be able to pull out what student joined a class with in a certain date range. Say I wanna get all the students who joined between 10/12/04 through 12/12/04. What is the easiest way to do this ? Can it be done with just a simple MySQL query ? I actually enter the date as shown above, I dont use the MySQL dates. Any help will be greatly appreciated. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.784 / Virus Database: 530 - Release Date: 10/27/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php