Jump to content

gevensen

Members
  • Posts

    206
  • Joined

  • Last visited

Everything posted by gevensen

  1. you can also check to see if your post is set or not by <?php session_start(); if(isset($_POST['lala']) { $_SESSION['a'] = $_POST['lala']; $a = 'abc'; } else { echo "SESSION NOT SET!"; } ?>
  2. you have to submit your post data no? if your passing along a post to another page it will pick it up but for example on the same page it would be if (isset($_POST['submit'])) { // if form has been submitted switch ($_POST['submit']) { case 'Submit': $_SESSION['lala']=$_POST['lala']; // the you can pass it along to the session break; case default: break; } }
  3. try downloading TOAD free it will help you make complex mysql statements in php
  4. and you can use a user table where you have an id then another table that has id linked_id filename where id is the id of the table 1,2,3,4 ect and linked_id is the user id from the database for example 12 and the filename picture.jpg then you do a sql search such as select * from picture_database where linked_id = $userid and that will list all the filenames associated with that user there may be some better ways but the is the way my pea brain works here is an actual table i use to track images CREATE TABLE IF NOT EXISTS `sc_expense_images` ( `id` int(11) NOT NULL AUTO_INCREMENT, `expense_id` int(11) NOT NULL, `filename` varchar(75) NOT NULL, PRIMARY KEY (`id`), KEY `sc_expense_id` (`expense_id`,`filename`), KEY `expense_id` (`expense_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=791 ;
  5. also you need some hacker checks when uploading a trick they use is to upload a htaccess file or a file named picture.php.jpg so you need to check for double file
  6. if you do some searching you can find a way to list all images in a directory use that to make a list of images in an array the use the move_uploaded_file to move the files to your new directory it can all be done automatically i wouldnt blob i was considering that myself but found it taxes the database too much its much easier to upload the file and record the filename and associate it with a user id than to break it down into a blob and then reassemle it
  7. it will make reports the best i have seen for free
  8. also if your having trouble with inserts or updates try doing a manual one from phpmyadmin and then changing the data, the format will be there
  9. error: <? echo . $row['JobNumber'] . ; ?> instead use <?php echo $row['JobNumber'] ; ?>
  10. i am doing a similar thing i think the easiest was is to make a pdf and print it ive been using it since this am and almost have a form where i can take data and fill out a deposit slip no matter how many checks are in the deposit it was the best solution i could find
  11. theres a similar thread http://www.phpfreaks.com/forums/index.php?topic=248238.0
  12. your making a huge security mistake inputting a post directly to your db thats a hackers dream i would at least use htmlspecialchars() for example $variable=htmlspecialchars($_POST['field']);
  13. populating your database with images? do you mean blobbing the images into the database or uploading images to a directory in jpgs or whatever?
  14. Im about to pull my hair out all of a sudden on wamp server i am getting Fatal error: Call to undefined function mysql_connect() in C:\wamp\www\sc\indexes\d56b699830e77ba53855679cb1d252da.php on line 10 where d56b699830e77ba53855679cb1d252da.php is my login page funny thing it works fine on my internet server but all of a sudden on wamp its calling mysql_connect() undefined??? any ideas?? its been working for months, i made no changes then all of a sudden today boom i am using php 5.2.8 on wampserver mysql_connect($servername, $dbusername, $dbpassword) or die(mysql_error()); $dbname=$masterlogin; mysql_select_db($dbname) or die("CANNOT SELECT DATABASE - ".$dbname." ". mysql_error());
  15. actually the best solution i have found is fpdf since i posted this export to to a pdf form and print the form now i just have to get up to speed on it
  16. pr just a steer in the right direction i see theres no good way i have found with php
  17. gevensen

    $_GET

    disadvantages are hackers trying to input code you would need something like this to avoid that the call: whatevevername.php?id=1 the receiving code if(isset($_GET['id')) { $id=htmlspecialchars($_GET['id']; } that messes up a hack attempt instead of just trying to bring the data into a variable that could be executed for example if you echoed echo "$id"; if there was a hack in there you would be executing the code i do that with post too
  18. Does anyone know of a decent tutorial for creating printable forms with php i am trying to fill out a deposit slip from mysql and print it the data is not a problem just learning how to format it for the printer thanks
  19. i have a table that will only use 2 fields every so often and in some cases not at all a varchar with a len of 4 and a varchar with a len of 75 with the current storage available now my question is this is it worth the time splitting that part of a table for storage purposes IOW create a new table with id (int) and the a fields to link to the old table???
  20. Wouldn't you need to assign a variable For ex $country='USA'; $countrycode=1; Then the end of the insert statement would be ('$country','$countrycode') making sure as stated the comma is there?
  21. ok i figured it out i had to redo the tables it only seems to work with 2009-01-4 not 2009-1-4 the 0 being on the trailing edge of the month
  22. I have a working query SELECT * FROM sc_income WHERE ( full_name = 'Allig, Emily' AND service_date BETWEEN '2009-1-1' AND '2009-2-1' ) the problem i am having is a record from 2009-1-4 ( date taken from table ) will not show up if i query BETWEEN '2009-1-1' AND '2009-1-31' any ideas as to why this might be once i query BETWEEN '2009-1-1' AND '2009-2-1' it shows up????
  23. ok thats easy enough to convert thanks somewhere deep down i knew that and couldnt remember it
×
×
  • 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.