[PHP] Re: I-worm/Klez and a GIF query/question
Ok so is there a tutorial on how to write the code to generate the key and the image? Please point me to it. Thanks Jennifer "R" <[EMAIL PROTECTED]> wrote in message 007501c1f304$3c1607a0$0a6da8c0@lgwezec83s94bn">news:007501c1f304$3c1607a0$0a6da8c0@lgwezec83s94bn... > Hey all, > Whah, talk about getting a response, I posted the I-Worm/Klez question > hoping to get one or two replies of people who actually got infected..I > got more than 40 replies! > I got two more today, but one poor dude says he got around 149 and counting! > Anyway, thanks for your replies guys/girls and for the URLs, but > 'nuff about virus's back to PHP > > I got a client who want a simple registeration form (Which i can do without > any problem...easy.) > but he wants one extra bit: > at the end of the form he wants a "key" gif...(A gif with a number) > that is automatically generated and that number has to be entered into the > text boxthe idea is that it prevents automaited registerations. > Yahoo and a couple of other big sites/portals use it. For those of you who > dont know what i am talking about and are curious to see an example, try > registering for an account at yahoo mail or chat or something. > > I understand that the new version of PHP/GD or whatever does not support GIF > and i also know for PNG or JPEG i can use LIBJPEG and LIBPNG (both are > installed on my webhost) but how do i do it in GIF? > (He insists on GIF- the clients a #@ his money helps pay the bills) > > Any ideas? and if any of you guys done anything similar, can give me the > function/s or any help? > > ANY help appreciated and guys.please dont send me anything more about > I-Worm/Klez...I apoligise about that. > All feedback appreciated even ones that just want to flame me. :-) > > Cheers, > -Ryan. > > /* If you see a cop beating me, put down the @$#@ing camera and come help > me! */ > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Columns not displaying as they should
Hi to everyone, I am having trouble with this snip and wonder if you might help? This is suppose to display the items 5 accross the browser instead it displays them down like this: item 1 item 2 item 3 I want them displayed like this: item1 item 2 item 3 but for some odd reason it wont any ideas why? if ($main == "shop") { $get_shop_data = mysql_fetch_array(mysql_query("SELECT * FROM wt_items WHERE id = '$shopid'")); $get_items = mysql_query("SELECT * FROM wt_instock WHERE shop = '$shopid' AND howmany > '0'"); while ($items_result = mysql_fetch_array($get_items)) { $item_info = mysql_fetch_array(mysql_query("SELECT * FROM wt_items WHERE id = '$items_result[item]'")); $column++; $display_block =" $item_info[name] $items_result[howmany] in stockCost: $items_result[price] "; echo "$display_block"; if ($column > 5) { echo ""; $column = 1; } echo""; } } Thanks for your time and help Jennifer -- The sleeper has awaken --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail() through a form
Hello to all, I have a mail script with a set of options in a dropdown list that I'm hoping you can help with. Here is the part I wish to get working then after that I can do the rest What I need this to do is send the users name, email address, the option in the drop down list, and the message. I can't seem to get it to do this could someone point out what I have done wrong? $query = "SELECT * FROM {$config["prefix"]}_users WHERE uid = {$session["uid"]}"; $result = mysql_query($query); $row = mysql_fetch_array($result); $name = $row['name']; $email = $row['email']; if($submit) { if($automail == 'abuse') { $From = $name; $to = "[EMAIL PROTECTED]"; mail( $to, $From, $email, $message ); } else { else { echo""; echo "Your User Name: $name"; echo "Your Email Address: $emailDid your emailchange? Click here"; echo "This is a "; echo ""; echo "Abuse"; echo "Bug"; echo "Employment"; echo " Report"; echo "The message is"; echo ""; echo ""; echo ""; echo ""; } Thanks Jennifer -- The sleeper has awaken --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Redirect
Hi to all, I am wondering if there are other ways to redirect users other than using header()? I have a script that if the user doesn't have enough money to buy an item then it directs to one page and if they do then it directs them back to the referring page. Is this possible? Thanks Jennifer -- The sleeper has awaken --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SQL Warning
Hi all, Would you please direct your attention to this URL http://testphp.netfirms.com/code1.html Look at the bottom where the big orange commented syntax is and explain what is going on there? Thanks Jennifer -- The sleeper has awaken --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] If else question
I have it. I actually got it! I had the if statement in the wrong place. Here is what I did: if($quantity <1) { echo "Sorry I can't seem to locate this item"; } else { //check if form has been submitted if($submit) { } else { //if the form has not been submitted run the following echo ""; echo ""; echo "$thisoption"; echo "Put in my shop"; echo "Put into my Footlocker"; echo "Discard this item"; echo "Donate this item"; echo ""; echo ""; echo ""; } } } and it worked perfectly! Thank you ALL for your time and help! Jennifer P.S. You people are wonderfull! --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] If else question
Ok I have hard coded $quantity so it does = 0 and else still prints. "Maxim Maletsky )" <[EMAIL PROTECTED]> wrote in message 004701c1eaf1$c915c6b0$92e3021a@machine52">news:004701c1eaf1$c915c6b0$92e3021a@machine52... > > Try this, Jennifer: > > Without messing the rest of your code, change the line: > > $quantity = $row['quantity']; > > With this one: > > $quantity = 0; > > In other words: hardcode it for testing. > > If "else" always prints, then you are missing something in your query. > Otherwise you've got something wrong in your code. > > > > > > Sincerely, > > Maxim Maletsky > Founder, Chief Developer > > www.PHPBeginner.com // where PHP Begins > > > > > -Original Message- > From: Jennifer Downey [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 23, 2002 7:48 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] If else question > > > Ok you asked for it. > Don't say I didn't warn you. > > session_start(); > $query = "SELECT name FROM {$config["prefix"]}_users WHERE > uid={$session["uid"]}"; $ret = mysql_query($query); while($row = > mysql_fetch_array($ret)) { > > $user = $row['name']; > > > > $query = "SELECT uid, id, iname, image, quantity, type FROM > {$config["prefix"]}_my_items WHERE uid={$session["uid"]} AND id = '$id' > ORDER BY id"; $ret = mysql_query($query); while($row = > mysql_fetch_array($ret)) { > $uiid = $row['uid']; > $iid = $row['id']; > $image = $row['image']; > $iname = $row['iname']; > $quantity = $row['quantity']; > $type = $row['type']; > // this is the problem if statement. Please don't yell at me for my > style. It is easy for me to read so I'm sorry if it's not for you. > if($quantity < 1) { echo "Sorry I can't seem to locate this item"; } > else { > > session_register("uiid"); > session_register("iid"); > session_register("image"); > session_register("iname"); > session_register("quantity"); > session_register("type"); > > >if($iid == $id) >{ > > $display_block .=" 2>$iname$quantity$type"; > > echo "$display_block"; > > if($type == "food") > //if the item food is present then set an option and include in > the form later > { >$thisoption="Feed my pet\n"; > } > else > { > //if book or weapon is present then set a blank > $thisoption=""; >} > } > } > } > } > //check if form has been submitted > if($submit) > { > > } > else > { > > //if the form has not been submitted run the following > > >echo ""; >echo ""; >echo "$thisoption"; >echo "Put in my shop"; >echo "Put into my Footlocker"; >echo "Discard this item"; >echo "Donate this item"; >echo ""; >echo ""; >echo ""; > > > } > > Jennifer > > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] If else question
You are on the right track. "-Bd-" <[EMAIL PROTECTED]> wrote in message 00a301c1eaf3$b181a260$[EMAIL PROTECTED]">news:00a301c1eaf3$b181a260$[EMAIL PROTECTED]... > am i off on the wrong track here? i thought the original problem was that > both clauses in the if statement were exectuting (the 'if' and the 'else')? > > > > > > > > Now, we're getting somewhere!!! > > > > First, have you printed out $query to ensure it contains what you > expected? > > Show us. > > > > Second, are you certain the mysql_query() is successful? I ask, because > you > > don't have the "or die()" that SHOULD be on all queries. > > > > Third, have you printed out all the values fetched via mysql_fetch_array() > > to ensure they contain valid data? > > > > - Original Message - > > From: Jennifer Downey <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Tuesday, April 23, 2002 12:48 PM > > Subject: Re: [PHP] If else question > > > > > > Ok you asked for it. > > Don't say I didn't warn you. > > > > session_start(); > > $query = "SELECT name FROM {$config["prefix"]}_users WHERE > > uid={$session["uid"]}"; > > $ret = mysql_query($query); > > while($row = mysql_fetch_array($ret)) > > { > > > > $user = $row['name']; > > > > > > > > $query = "SELECT uid, id, iname, image, quantity, type FROM > > {$config["prefix"]}_my_items WHERE uid={$session["uid"]} AND id = '$id' > > ORDER BY id"; > > $ret = mysql_query($query); > > while($row = mysql_fetch_array($ret)) > > { > > $uiid = $row['uid']; > > $iid = $row['id']; > > $image = $row['image']; > > $iname = $row['iname']; > > $quantity = $row['quantity']; > > $type = $row['type']; > > // this is the problem if statement. Please don't yell at me for my style. > > It is easy for me to read so I'm sorry if it's not for you. > > if($quantity < 1) > > { > > echo "Sorry I can't seem to locate this item"; > > } > > else > > { > > > > session_register("uiid"); > > session_register("iid"); > > session_register("image"); > > session_register("iname"); > > session_register("quantity"); > > session_register("type"); > > > > > >if($iid == $id) > >{ > > > > $display_block .=" > 2>$iname$quantity$type"; > > > > echo "$display_block"; > > > > if($type == "food") > > file://if the item food is present then set an option and include in > > the > > form later > > { > >$thisoption="Feed my pet\n"; > > } > > else > > { > > file://if book or weapon is present then set a blank > > $thisoption=""; > >} > > } > > } > > } > > } > > file://check if form has been submitted > > if($submit) > > { > > > > } > > else > > { > > > > file://if the form has not been submitted run the following > > > > > >echo ""; > >echo ""; > >echo "$thisoption"; > >echo "Put in my shop"; > >echo "Put into my Footlocker"; > >echo "Discard this item"; > >echo "Donate this item"; > >echo ""; > >echo ""; > >echo ""; > > > > > > } > > > > Jennifer > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] If else question
Ok you asked for it. Don't say I didn't warn you. session_start(); $query = "SELECT name FROM {$config["prefix"]}_users WHERE uid={$session["uid"]}"; $ret = mysql_query($query); while($row = mysql_fetch_array($ret)) { $user = $row['name']; $query = "SELECT uid, id, iname, image, quantity, type FROM {$config["prefix"]}_my_items WHERE uid={$session["uid"]} AND id = '$id' ORDER BY id"; $ret = mysql_query($query); while($row = mysql_fetch_array($ret)) { $uiid = $row['uid']; $iid = $row['id']; $image = $row['image']; $iname = $row['iname']; $quantity = $row['quantity']; $type = $row['type']; // this is the problem if statement. Please don't yell at me for my style. It is easy for me to read so I'm sorry if it's not for you. if($quantity < 1) { echo "Sorry I can't seem to locate this item"; } else { session_register("uiid"); session_register("iid"); session_register("image"); session_register("iname"); session_register("quantity"); session_register("type"); if($iid == $id) { $display_block .="$iname$quantity$type"; echo "$display_block"; if($type == "food") //if the item food is present then set an option and include in the form later { $thisoption="Feed my pet\n"; } else { //if book or weapon is present then set a blank $thisoption=""; } } } } } //check if form has been submitted if($submit) { } else { //if the form has not been submitted run the following echo ""; echo ""; echo "$thisoption"; echo "Put in my shop"; echo "Put into my Footlocker"; echo "Discard this item"; echo "Donate this item"; echo ""; echo ""; echo ""; } Jennifer --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] If else question
No this is the first if statement but there are nested if's after that. I'd post the code but everyone yells at me about my coding style. If you promise not to yell I will post it. Jennifer "-Bd-" <[EMAIL PROTECTED]> wrote in message 001d01c1eae9$d58f4360$[EMAIL PROTECTED]">news:001d01c1eae9$d58f4360$[EMAIL PROTECTED]... > Is this a nested if? (inside another if statement?) > > > > > - Original Message - > From: "Jennifer Downey" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, April 23, 2002 1:05 PM > Subject: Re: [PHP] If else question > > > > > > I just looked at my hosting service thinkg it may have been because they > > just upgraded to 4.1 php. so I dumped my database and loaded it to my > > machine at home and find that it does the same thing. > > > > I have 4.06 php on win me my hosting service is 4.1 php on redhat linux so > > I'm thinking that is not the case. > > > > I have used this code through out my site and this is the only part it > does > > this on and I am not understanding why. > > > > Jennifer > > > > > > > > > > "Natalie Leotta" <[EMAIL PROTECTED]> wrote in message > > 7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG... > > > My officemate and I talked about this and the only thing he could come > up > > > with was a possible problem with your parser. Are you using a beta > > version > > > or something unusual? I don't know if you have a way to know this - the > > > programmers didn't set up PHP where I work, but I know our web server is > > > apache and it's on a unix box. I've never run into this problem before. > > > Have you had it happen in other programs? Have you ever used this code > in > > > another program? If it's consistently incorrect then it may be a > problem > > > with your parser. That's not really my area of expertise, but it's > > > something you could look into if no one else has any better ideas :-) > > > > > > -Natalie > > > > > > -Original Message- > > > From: Jennifer Downey [mailto:[EMAIL PROTECTED]] > > > Sent: Tuesday, April 23, 2002 12:26 PM > > > To: [EMAIL PROTECTED] > > > Subject: Re: [PHP] If else question > > > > > > > > > It shows both. > > > > > > "Natalie Leotta" <[EMAIL PROTECTED]> wrote in message > > > 7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG... > > > > Does it show the message and the form or just the message? > > > > > > > > -Natalie > > > > > > > > -Original Message- > > > > From: Jennifer Downey [mailto:[EMAIL PROTECTED]] > > > > Sent: Tuesday, April 23, 2002 12:23 PM > > > > To: [EMAIL PROTECTED] > > > > Subject: Re: [PHP] If else question > > > > > > > > > > > > > > > > > If and else expect to be followed by exactly 1 statement. To > > > > > aggregate multiple statements as one, surround them with {curly > > > > > braces}. I'm guessing you didn't do that, and you're seeing the > > > > > execution of all but the first of the statements following the else. > > > > > > > > > > So it should be: > > > > > > > > > > if ($var<1) > > > > > echo "can't be found"; > > > > > else > > > > > { > > > > > echo "first line of form"; > > > > > echo "second line of form"; > > > > > } > > > > This is what I have: > > > > > > > > if($quantity < 1) > > > > { > > > > echo "Sorry I can't seem to locate this item"; > > > > } > > > > else > > > > { > > > > do this > > > > } > > > > So yes I have done exactly as you have stated and it still shows the > > > > form. > > > > > > > > Jennifer > > > > > > > > > > > > --- > > > > Outgoing mail is certified Virus Free. > > > > Checked by AVG anti-virus system (http://www.grisoft.com). > > > > Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 > > > > > > > > > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) > > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > --- > > > Outgoing mail is certified Virus Free. > > > Checked by AVG anti-virus system (http://www.grisoft.com). > > > Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > --- > > Outgoing mail is certified Virus Free. > > Checked by AVG anti-virus system (http://www.grisoft.com). > > Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] If else question
I just looked at my hosting service thinkg it may have been because they just upgraded to 4.1 php. so I dumped my database and loaded it to my machine at home and find that it does the same thing. I have 4.06 php on win me my hosting service is 4.1 php on redhat linux so I'm thinking that is not the case. I have used this code through out my site and this is the only part it does this on and I am not understanding why. Jennifer "Natalie Leotta" <[EMAIL PROTECTED]> wrote in message 7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG... > My officemate and I talked about this and the only thing he could come up > with was a possible problem with your parser. Are you using a beta version > or something unusual? I don't know if you have a way to know this - the > programmers didn't set up PHP where I work, but I know our web server is > apache and it's on a unix box. I've never run into this problem before. > Have you had it happen in other programs? Have you ever used this code in > another program? If it's consistently incorrect then it may be a problem > with your parser. That's not really my area of expertise, but it's > something you could look into if no one else has any better ideas :-) > > -Natalie > > -Original Message- > From: Jennifer Downey [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 23, 2002 12:26 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] If else question > > > It shows both. > > "Natalie Leotta" <[EMAIL PROTECTED]> wrote in message > 7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG... > > Does it show the message and the form or just the message? > > > > -Natalie > > > > -Original Message- > > From: Jennifer Downey [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, April 23, 2002 12:23 PM > > To: [EMAIL PROTECTED] > > Subject: Re: [PHP] If else question > > > > > > > > > If and else expect to be followed by exactly 1 statement. To > > > aggregate multiple statements as one, surround them with {curly > > > braces}. I'm guessing you didn't do that, and you're seeing the > > > execution of all but the first of the statements following the else. > > > > > > So it should be: > > > > > > if ($var<1) > > > echo "can't be found"; > > > else > > > { > > > echo "first line of form"; > > > echo "second line of form"; > > > } > > This is what I have: > > > > if($quantity < 1) > > { > > echo "Sorry I can't seem to locate this item"; > > } > > else > > { > > do this > > } > > So yes I have done exactly as you have stated and it still shows the > > form. > > > > Jennifer > > > > > > --- > > Outgoing mail is certified Virus Free. > > Checked by AVG anti-virus system (http://www.grisoft.com). > > Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Browser cache
PLEASE TAKE THIS OUT OF MY THREAD. I am trying to get an answer to my question. Not yours. Thank you Jennifer "Stuart Dallas" <[EMAIL PROTECTED]> wrote in message 000d01c1eae5$96243450$de01420a@stuart">news:000d01c1eae5$96243450$de01420a@stuart... > José León Serna <[EMAIL PROTECTED]> wrote: > > Hello: > > How could I disable the browser cache?, I have a script that > > generates an image and shows it via . The problem > > is if I change the image, the browser doesn't reflect the changes > > until I push refresh. I supose is sending a header, but which header? > > Headers aren't the best way since some browsers do a great job of ignoring > them (or at least appearing to). The best way I've found to make sure the > content is retrieved from the server is to add ?n to the URL replacing > randomnumber with a random number (I usually use the return value from > time()). > > HTH, > Stuart > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] If else question
It shows both. "Natalie Leotta" <[EMAIL PROTECTED]> wrote in message 7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG... > Does it show the message and the form or just the message? > > -Natalie > > -Original Message- > From: Jennifer Downey [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 23, 2002 12:23 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] If else question > > > > > If and else expect to be followed by exactly 1 statement. To aggregate > > multiple statements as one, surround them with {curly braces}. I'm > > guessing you didn't do that, and you're seeing the execution of all > > but the first of the statements following the else. > > > > So it should be: > > > > if ($var<1) > > echo "can't be found"; > > else > > { > > echo "first line of form"; > > echo "second line of form"; > > } > This is what I have: > > if($quantity < 1) > { > echo "Sorry I can't seem to locate this item"; > } > else > { > do this > } > So yes I have done exactly as you have stated and it still shows the form. > > Jennifer > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] If else question
> If and else expect to be followed by exactly 1 statement. To aggregate > multiple statements as one, surround them with {curly braces}. I'm > guessing you didn't do that, and you're seeing the execution of all but > the first of the statements following the else. > > So it should be: > > if ($var<1) > echo "can't be found"; > else > { > echo "first line of form"; > echo "second line of form"; > } This is what I have: if($quantity < 1) { echo "Sorry I can't seem to locate this item"; } else { do this } So yes I have done exactly as you have stated and it still shows the form. Jennifer --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] If else question
Hi all, I am wondering. When you use an if else statement and a condition exists isn't the if part suppose to stop? Then if the condition doesn't exist it is suppose to do something else? I am wondering because I have a form that goes something like this. select such and such from the table if that condition < 1 echo that it can't be found else echo the form But in this case even if the condition < 1 it still echoes the form. I am not understanding this. Thanks for your time and help Jennifer -- The sleeper has awaken --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Using one submit button
Thank you Jason and Kevin for your time and help. Does this look like what I should have? if(isset($update)) for ($i=0; $i"; Jennifer "Jason Wong" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... > On Thursday 18 April 2002 00:11, Jennifer Downey wrote: > > I have no takers on this one? > > > > Just to let you know I have been working on this to here is some new code. > > What I need this to do is update the price in the db table. > > if I have on item it is fine. If I have two items it won't update the > > first items price but will the second. if I try to enter a price in the > > first items textbox it doesn't update and then deletes the second item's > > price. > > > > If I have 15 items and using one submit button how do I get this to update > > all items that are listed? > > > > $query = "SELECT uid, id, name, image, type, quantity, price FROM > > {$config["prefix"]}_shop WHERE uid = {$session["uid"]}"; > >$ret = mysql_query($query); > >while($row = mysql_fetch_array($ret)) > > { > >$uid = $row['uid']; > >$id = $row['id']; > >$name = $row['name']; > >$image = $row['image']; > >$iquantity = $row['quantity']; > >$itype = $row['type']; > >$iprice = $row['price']; > > > > if($update) > > { > > $eprice = '$price[]'; > > I don't know what else is wrong with your code, but this is *definitely* > going to cause problems. > > I assume you mean: > > $eprice = $price[]; > > But even this is wrong. You should probably be keeping a counter, eg $i, then > use: > > $eprice = $price[$i]; > > [snip] > > > value=\"\" name=\"price[]\" size='8' > > value=\"\" name=\"price[$i]\" size='8' > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > We have a equal opportunity Calculus class -- it's fully integrated. > */ --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Using one submit button
Thank you Jason and Kevin for your time and help. Does this look like what I should have? if(isset($update)) for ($i=0; $i"; Jennifer "Kevin Stone" <[EMAIL PROTECTED]> wrote in message 004301c1e633$e1e20090$6601a8c0@kevin">news:004301c1e633$e1e20090$6601a8c0@kevin... > - > I picked up your question soon after you submited it then my internet went > down so I wasn't able to send it. Looks like it's been answered by someone > else since then but here you go anyway. I didn't want to feel as though I'd > wasted my time. :D > -kevin > - > > Looks like you want to extract the values from the $price array in the same > order as you extracted the associated rows from the database. At first > glance I can say you aren't passing enough information to be able to > determine an order for updating. You'll need to send the product ids along > with the prices and then create a counter to loop through the ids array and > test each case. > > I would sugget you build an $id[] list the same way as the $price[] list but > generate them as hidden fields. Then within the if(isset($update)) > statement loop through all $id values for each itteration of the while > loop... > > for ($i=0; $i { > if ($id[$i] == $row[id]) > { > // we know that there are the same number of ids as there are prices > so we can use $i for the $price index as well. > $query = "UPDATE $table SET price = $price[$i] WHERE id = $id[$i]"; > // do update.. > } > } > > -Kevin > > - Original Message - > From: "Jennifer Downey" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, April 17, 2002 10:11 AM > Subject: [PHP] Re: Using one submit button > > > > I have no takers on this one? > > > > Just to let you know I have been working on this to here is some new code. > > What I need this to do is update the price in the db table. > > if I have on item it is fine. If I have two items it won't update the > first > > items price but will the second. if I try to enter a price in the first > > items textbox it doesn't update and then deletes the second item's price. > > > > If I have 15 items and using one submit button how do I get this to > update > > all items that are listed? > > > > $query = "SELECT uid, id, name, image, type, quantity, price FROM > > {$config["prefix"]}_shop WHERE uid = {$session["uid"]}"; > >$ret = mysql_query($query); > >while($row = mysql_fetch_array($ret)) > > { > >$uid = $row['uid']; > >$id = $row['id']; > >$name = $row['name']; > >$image = $row['image']; > >$iquantity = $row['quantity']; > >$itype = $row['type']; > >$iprice = $row['price']; > > > > if($update) > > { > > $eprice = '$price[]'; > > $query = "UPDATE {$config["prefix"]}_shop SET price = '$eprice' > > where uid = {$session["uid"]} AND id = '$id'"; > > $ret = mysql_query($query) or die(mysql_error()); > > } > > else > > { > > > > echo " > CELLSPACING='0'>"; > > echo ""; > > echo "$name"; > > echo " > size=2>$iquantity"; > > echo " > href='$PHP_SELF?id=$id&remove=yes'>X"; > > echo " > value=\"\" name=\"price[]\" size='8' > > MAXLENGTH='8'>"; > > echo ""; > >echo ""; > > } > > } > > echo " > Prices\">"; > > echo ""; > > "Jennifer Downey" <[EMAIL PROTECTED]> wrote in message > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > Hi all, > > > > > > I thought I was going to give php a break today but I can't it's too > > > adicting. > > > > > > I am having a little problem with a submit button in which it is suppose > > to > > > update records from a form. > > > > > > Here is the code > > > > > > > -- > > -- > > > > > > > > > > > > echo "My Locker | > > href=\"myshop.php\">My Sho
Re: [PHP] Using one submit button
Do you mean something like this? if($update) { $iprice = $price["price"]; $query = "UPDATE {$config["prefix"]}_shop SET price = $iprice where uid = {$session["uid"]} AND id = $id"; $ret = mysql_query($query); } "Martin Towell" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > user price[] as the name > you'll also need to pass the ids as $id[] > so you know which one you're updating > > -Original Message- > From: Jennifer Downey [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, April 17, 2002 11:51 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Using one submit button > > > Hi all, > > I thought I was going to give php a break today but I can't it's too > adicting. > > I am having a little problem with a submit button in which it is suppose to > update records from a form. > > Here is the code > > -- -- > > > > echo "My Locker | href=\"myshop.php\">My Shop | My > Items"; > echo " width=20%>Image size=2>Name size=2>Quantity size=2>Remove Item size=2>Price"; > echo ""; > > $query = "SELECT uid, id, name, image, type, quantity FROM > {$config["prefix"]}_shop WHERE uid = {$session["uid"]}"; > $ret = mysql_query($query); > while($row = mysql_fetch_array($ret)) > { > $uid = $row['uid']; > $id = $row['id']; > $name = $row['name']; > $image = $row['image']; > $iquantity = $row['quantity']; > $itype = $row['type']; > > > echo " CELLSPACING='0'>"; > echo ""; > echo "$name"; > echo " size=2>$iquantity"; > echo " href='$PHP_SELF?id=$id&remove=yes'>X"; > echo " value=\"\" name=\"price\" size='6' > MAXLENGTH='8'>"; > echo ""; > > echo ""; > } > echo " Prices\">"; > echo ""; > if($update) > { > $query = "UPDATE {$config["prefix"]}_shop SET price = '$price' > where uid = {$session["uid"]}"; > $ret = mysql_query($query); > } > > > > -- -- > > > > > What I need this to do is update the price in the db table. > if I have on item it is fine. If I have two items it won't update the first > items price but will the second. if I try to enter a price in the first > items textbox it doesn't update and then deletes the second item's price. > > If I have 15 items and using one submit button how do I get this to update > all items that are listed? > > TIA > Jennifer > > -- > The sleeper has awaken > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002 > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using one submit button
Hi all, I thought I was going to give php a break today but I can't it's too adicting. I am having a little problem with a submit button in which it is suppose to update records from a form. Here is the code echo "My Locker | My Shop | My Items"; echo "ImageNameQuantityRemove ItemPrice"; echo ""; $query = "SELECT uid, id, name, image, type, quantity FROM {$config["prefix"]}_shop WHERE uid = {$session["uid"]}"; $ret = mysql_query($query); while($row = mysql_fetch_array($ret)) { $uid = $row['uid']; $id = $row['id']; $name = $row['name']; $image = $row['image']; $iquantity = $row['quantity']; $itype = $row['type']; echo ""; echo ""; echo "$name"; echo "$iquantity"; echo "X"; echo ""; echo ""; echo ""; } echo ""; echo ""; if($update) { $query = "UPDATE {$config["prefix"]}_shop SET price = '$price' where uid = {$session["uid"]}"; $ret = mysql_query($query); } What I need this to do is update the price in the db table. if I have on item it is fine. If I have two items it won't update the first items price but will the second. if I try to enter a price in the first items textbox it doesn't update and then deletes the second item's price. If I have 15 items and using one submit button how do I get this to update all items that are listed? TIA Jennifer -- The sleeper has awaken --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP MySQL Hosting services
Hi everyone, I am wondering if anyone has a good hosting service? I am currently with Aletia which has an excellant package good tech support but sometimes not very functional servers. My site has gone down at least 3 times within the last 20 days. Too many for me. It has to be at least 50 mb disk space, 10 to 15gig /m transfer, of course PHP and MySQL, ftp, ssh or telnet, cgi/perl, free domain transfer, at least 15 POP3 email accounts, cron support. Thanks Jennifer -- The sleeper has awaken --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Closing curly brackets?
Well as I have seen lot's of people get yelled at if they post in the wrong list. So rather than letting that happen and risk not getting any help I thought I would apologize and send it to the right list. Anyway the file you sent is it in the correct format? I have asked about a tutorial on proper code formatting and got back a tutorial that was extremely hard to understand. While lots of people have screamed at me for my coding format no one has supplied an understandable answer. That is until this morning. >From Paul Burney : Hi Jennifer, The first thing you should do is properly indent your code. If you do so, you'll be sure to find the missing bracket. Basically, for each new block, tab out again. It really helps to use a programmer's editor with syntax highlighting like vim or BBEdit. Thought that was the best tutorial I could ever get. Short and sweet and oh so easy to understand. I am using HTML_Kit as it has the same features as all the othere editors (color coding and such) but it also has a lot more I can get plugins for anything I would ever need. Except a formatting tutorial ;) I will use your code as an example of formatting. It doesn't work as far as the script goes as it returns multiple: Warning: Supplied argument is not a valid MySQL result resource. So I am going to study your formatting and start at the beginning. But thank you for your time and help! :) You have been a great help, look at my new signature. Thanks again Jennifer --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Closing curly brackets?
My apologies for putting this in the wrong list. Jennifer "Jennifer Downey" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi everyone, > > I have a question about this code. The way it sits now it always shows the > last record in the table. > in other words if the user has 6 items, like: > item id 1 > item id 2 > item id 5 > item id 6 > item id 7 > item id 8 > > it will only show the last record item id 8. > > I believe it has something to do with the first while statement's closing > curly bracker > But I can't seem to get it in the right place. > > Can someone spot the mistake and show me how to fix it. > see also comments in code. > > > > $id = $HTTP_GET_VARS["id"]; > > > $query = "SELECT id, name, image, quantity, type FROM > {$config["prefix"]}_my_items WHERE uid={$session["uid"]} ORDER BY id"; > $ret = mysql_query($query); > while($row = mysql_fetch_array($ret)) > { > $iid = $row['id']; > $image = $row['image']; > $name = $row['name']; > $quantity = $row['quantity']; > $type = $row['type']; > > > if($iid == $id) > { > $display_block =" 2>$name$quantity$type"; > echo "$display_block"; > if($type == "food") > //if book or weapon is present then set an option and include in the form > later > {$thisoption="Feed my pet\n"; > }else{ > //if any other type is present then set a blank > $thisoption="";} > } > } > > > > //check if form has been submitted > if($submit){ > >if($sort == 'shop') > { > echo "This item has been taken care of"; > > // We are selecting user id to insert into the users items. > $db="SELECT uid FROM {$config["prefix"]}_users WHERE > uid={$session["uid"]}"; > $ret = mysql_query($db); > while(list($db)=mysql_fetch_row($ret)) > { $user = $db; > echo "Your user ID is $user"; > } > > > echo "You have $quantity of this item and it's id is $iid"; > > > } > // it seems like the first while statement's closing curly bracket should go > here but if I put it here I get a pars error. > }else{ > //if the form has not been submitted run the following > > > ?> > " METHOD="post"> > > > Put in my shop > Put into my Footlocker > Discard this item > Donate this item > > > > } > //if I put the first while statement's closing curly bracket here it works > great except it prints multiple dropdown lists on the page. > > I have tried the bracket in numerous places but I can't find the right spot. > > > > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002 > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Closing curly brackets?
Hi everyone, I have a question about this code. The way it sits now it always shows the last record in the table. in other words if the user has 6 items, like: item id 1 item id 2 item id 5 item id 6 item id 7 item id 8 it will only show the last record item id 8. I believe it has something to do with the first while statement's closing curly bracker But I can't seem to get it in the right place. Can someone spot the mistake and show me how to fix it. see also comments in code. $id = $HTTP_GET_VARS["id"]; $query = "SELECT id, name, image, quantity, type FROM {$config["prefix"]}_my_items WHERE uid={$session["uid"]} ORDER BY id"; $ret = mysql_query($query); while($row = mysql_fetch_array($ret)) { $iid = $row['id']; $image = $row['image']; $name = $row['name']; $quantity = $row['quantity']; $type = $row['type']; if($iid == $id) { $display_block ="$name$quantity$type"; echo "$display_block"; if($type == "food") //if book or weapon is present then set an option and include in the form later {$thisoption="Feed my pet\n"; }else{ //if any other type is present then set a blank $thisoption="";} } } //check if form has been submitted if($submit){ if($sort == 'shop') { echo "This item has been taken care of"; // We are selecting user id to insert into the users items. $db="SELECT uid FROM {$config["prefix"]}_users WHERE uid={$session["uid"]}"; $ret = mysql_query($db); while(list($db)=mysql_fetch_row($ret)) { $user = $db; echo "Your user ID is $user"; } echo "You have $quantity of this item and it's id is $iid"; } // it seems like the first while statement's closing curly bracket should go here but if I put it here I get a pars error. }else{ //if the form has not been submitted run the following ?> " METHOD="post"> Put in my shop Put into my Footlocker Discard this item Donate this item http://www.grisoft.com). Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Forms in PHP
Actually after the submit button is clicked it returns a blank page. "Jennifer Downey" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi all, > > Now I have a weird problem. I am using this code and can't understand why it > doesn't work. > When the script is run it returns a blank page, no error or done. > > here it is and any help would be appreciated. > > if(($type == book) or ($type == weapon)){ > echo ""; > echo ""; > echo "Put in my shop"; > echo "Put into my Footlocker"; > echo "Discard this item"; > echo "Donate this item"; > echo ""; > echo ""; > > > > if(isset($submit)) > { > > if($sort == "shop") > { > echo "done" or die("Not!"); > } > } > } > elseif($type==food) > { > > echo ""; > echo "Feed my pet"; > echo "Put in my shop"; > echo "Put into my Footlocker"; > echo "Discard this item"; > echo "Donate this item"; > echo ""; > echo ""; > echo ""; > > > } > } > } > > Thanks for your time > Jennifer > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002 > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Forms in PHP
Hi all, Now I have a weird problem. I am using this code and can't understand why it doesn't work. When the script is run it returns a blank page, no error or done. here it is and any help would be appreciated. if(($type == book) or ($type == weapon)){ echo ""; echo ""; echo "Put in my shop"; echo "Put into my Footlocker"; echo "Discard this item"; echo "Donate this item"; echo ""; echo ""; if(isset($submit)) { if($sort == "shop") { echo "done" or die("Not!"); } } } elseif($type==food) { echo ""; echo "Feed my pet"; echo "Put in my shop"; echo "Put into my Footlocker"; echo "Discard this item"; echo "Donate this item"; echo ""; echo ""; echo ""; } } } Thanks for your time Jennifer --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Tutorial on proper code formating
Thank you all for your input. I will read through the tutorial and then figure out which style I want to use. I appreciate your time. Jennifer "Jennifer Downey" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi all, > > Could someone point me to a tutorial on the proper way to format code. To > make it more readable. > > TIA > Jennifer > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002 > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Tutorial on proper code formating
Hi all, Could someone point me to a tutorial on the proper way to format code. To make it more readable. TIA Jennifer --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Getting user name in text area
Hi all, Here is what I have and what I am trying to do. I would like the user name to be printed in the Username text box but can't seem to get it there. I don't want the user to have to type there username in, just click the submit button and it is entered into the db. Can anyone show me what I have done wrong? $query="SELECT name FROM users WHERE uid={$session["uid"]}"; $ret = mysql_query($query); while(list($name)= mysql_fetch_row($ret)) print("$name"); ?> Username: "; print ""; ?> http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MySQL and indexes
Hi all, Just wondering, does a table have to have an index? If so what should I consider when making a colum an index? Here is the table I am using but I can't get php to update it. Is it because there is no index? CREATE TABLE wt_pet ( petid varchar(100) default NULL, pet_user int(10) NOT NULL default '0', petname varchar(50) NOT NULL default '', pet_sex enum('Male','Female') NOT NULL default 'Male', pet_equip varchar(50) NOT NULL default '', pet_state varchar(20) NOT NULL default '', pet_hunger varchar(20) NOT NULL default '', pet_date date NOT NULL default '-00-00', num_pets int(1) NOT NULL default '0', ) TYPE=MyISAM; Thanks Jennifer Downey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] DHTML Trouble please help
Hi all, I am no DHTML expert and don't even know the language also didn't know where to post this. But after today I am going to learn. I downloaded a tetris game from Dynamic Drive: http://www.dynamicdrive.com/dynamicindex12/tetris/index.htm Have a look. I would add it here but it's too long. I want to add the high score to a users data in the database. Would one of you DHTML and PHP Gurues (SP) please point out what section of the code I would use to get the high score. I would like to (I can do this part if someone would show what I use from the DHTML) echo or print the score to the bottom of the browser window and then have that added to the db. TIA GC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Random number Question
Hi all, I having a hard time understanding why this won't work. I have a form which is suppose to pass the guess to the script. Here it is: the form is guess.php: The computer has picked a number between 1 and 10. Guess the number and you win! Enter your guess: The script is number.php: You have won!"; }else{ print("Sorry that wasn't the answer"); } ?> Any help would be appreciated. Thanks in advance Jennifer Downey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php