Jump to content

anthylon

Members
  • Posts

    86
  • Joined

  • Last visited

    Never

About anthylon

  • Birthday 02/13/1979

Contact Methods

  • Website URL
    http://www.crtalo.info

Profile Information

  • Gender
    Male

anthylon's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Here you go Mr. Ear - just kidding - check the following topic http://www.phpfreaks.com/forums/index.php/topic,281071.msg1331956.html Good luck!
  2. Are you sure that you want to upload image in your database? Having images in database will slow down your application completely :'(. I wouldn't do that but it depends off your application requirements. Anyway, my advice: do not do that! Don't save image in database instead of storing image path only.
  3. I am sorry buddy - it wasn't my intent to be rude :-\ English is not my native language. By the way I can't make decision which mouse to order so I am suffering with touch pad on my laptop. Also I feel very ill these days so please be patient with me . Here is some quick code I wrote fast for you (it could be better but you will find out). Hidden field of course needs to be part of your HTML script (inside of <form></form> tags of the form that user will submit. There are some other ways using JavaScript but this one is easier for me to explain . So here you go - I hope this will work for you <html> <head> <title>Form with hidden field - Test by Anthylon </title> </head> <body> <?php if (! isset($_POST['m_text']) ) $preview = '-1'; else $preview = $_POST['preview']; if (isset($_POST['m_text'])) { $m_text = $_POST['m_text']; if($preview == '-1') { $preview = '1'; echo "This is <strong>preview</strong> with option to change:<p>Dear customer, <br>Are you sure you want to save text = <strong>$m_text</strong>? <br>This is your last chance to make some changes </p>"; //put some code here }else{ echo "Information text=<strong>$m_text</strong> stored - Thank you!"; die(); //not smart idead - don't do this ! ... } } else { $m_text = ''; //just to avoid notice "Notice: Undefined variable: m_text in..." echo 'Please type something in the text field below:'; } ?> <form method="POST"> <input type="text" name="m_text" value="<?php print $m_text?>"> <input type="hidden" name="preview" value="<?php print $preview ?>"> </form> </body> </html> Of course if you have form used for shopping (example) and expecting from user to close browser and have an option to continue later than you should use cookies as ym_chaitu mentioned. Good luck! P.S. I started with clipper 5.1
  4. @co.ador Oh that is right . Sorry about confusion with NOW() function. I haven't use PHP for a pretty much long period :-\ - working in another field right now (better pay) Thanks!
  5. Hm, even if he is using SELECT * FROM... it still must return name of column. As cags said he should try print_r($row); and see how it looks like.
  6. You don't need to have any quotes around numeric value in SQL query. Are you sure your IP field is numeric? - I don't see why would be numeric except if you making some conversion but stil... Maybe that is what cause error. I would set IP address field to string and it would be like I wrote in previous comment.
  7. Sorry about that! :'( Have you tried with analogy: mssql_fetch_assoc($query) ? It must work!
  8. Try using mysql_fetch_assoc directive instead of mysql_fetch_array. It will return recordset with column names instead of index number. Please, set the topic status [solved] if this works for you!
  9. You may use few directives. Depends what you want achieve try with: require_once("2nd.php"); From that point you may call/use variables and functions from 2nd.php as your local - depends of range. It acts like you have code from both scripts executing in one single file. Cheers!
  10. Your question is confusing me! You want to select random style (CSS) and than what?
  11. Try this - it should work: $query1="INSERT INTO rating (item_name, rating, ip_address, date_rated) VALUES ('$varItem', $varRating, '$ipAddress'," .now() .");"; I assume ip_address is numeric field.
  12. It is very easy task. You should include some checking before sending email. So what you need to do is to check if form was submitted by use (I assume you are doing this before sending email). If form was submitted by user than you could use some hidden field to store some value for example: review=1. Example if review = 0 (user didn't made review yet) you should give the summary of entered information for review. Do you understand my idea or you need better explanation? Regards
  13. No man! That would be suicide - your database would be huge and toooo slow. Think once again - instead of storing image in database you will store simple images/forum/avatar/user_x_avatar_0001092whatever_unique_name.jpg. Actually here is what you should have: 1. in config file somewhere you should have stored path to user avatars: $avatar_path = example images/forum/avatar 2. in user table add additional field: img_avatar and store name of image assigned for user There you go! Next time when you need to show image for specific user just echo image HTML elements. Example: <img id="avatar" class="img_avatar" src="<?php echo $avatar_path .'/' .$row['img_avatar']" width="80px" height="80px"> Buddy, do whatever you want but don't store image in database :-\
  14. This seems the fastest way originally explained by TheBlueEys on another forum. It uses binary numbers but if you want to check read google it or do some testing. $result = mysql_query("select * from pmd_categories where level = '1' "); $counter = 0; while($row = mysql_fetch_array($result)) { if($counter & 1) { echo "Odd row here"; }else{ echo "Even row here"; } $counter++; } Of course you will have to make simple HTML in order to render your output in two columns. But I am assuming you are not requesting that kind of help .
  15. I don't understand why would you store images in database? Keeping images in database doesn't seem as nice idea to me. :-\ I would suggest to keep images in regular folders/sub-folders and keep only path to them in database if required.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.