Search found 300 matches

by simplypixie
Sun Nov 17, 2013 9:43 pm
Forum: PHP coding => General
Topic: erase $_POST data after submition
Replies: 3
Views: 1061

Re: erase $_POST data after submition

Sorry I can't see the problem and I have just tested your code and when I first submit, the value is echo'd out as expected and when I submit a second time it is not so it is working fine as far as I can see.
by simplypixie
Thu Nov 14, 2013 12:14 am
Forum: PHP coding => General
Topic: erase $_POST data after submition
Replies: 3
Views: 1061

Re: erase $_POST data after submition

If you want to remove all posted data you can just use

Code: Select all

unset($_POST);
If you want to just remove a specific posted variable / key, you would be more specific

Code: Select all

unset($_POST['key_name_here']);
by simplypixie
Mon Oct 28, 2013 4:42 am
Forum: PHP coding => General
Topic: Insert record in PHP
Replies: 23
Views: 3439

Re: Insert record in PHP

In which case I really don't understand your problem as it is already in the correct format for the date field in your database - you can just update without doing any changes or formatting.
by simplypixie
Mon Oct 28, 2013 3:14 am
Forum: PHP coding => General
Topic: Insert record in PHP
Replies: 23
Views: 3439

Re: Insert record in PHP

OK, is that the 4th December or the 12th April?
by simplypixie
Mon Oct 28, 2013 2:44 am
Forum: PHP coding => General
Topic: Insert record in PHP
Replies: 23
Views: 3439

Re: Insert record in PHP

Sunny, I have answered this twice for you now and you keep changing your date format - so far you have said I want it in dd-mm-yyyy , When i enter value as 20/05/1978 , Date is entered in this format 20-05-1978 and I want if i enter 1970/04/10 . That is 3 different date formats! What EXACT format is...
by simplypixie
Mon Oct 28, 2013 2:13 am
Forum: PHP coding => General
Topic: Insert record in PHP
Replies: 23
Views: 3439

Re: Insert record in PHP

@tiger - you are correct, thank you for spotting
by simplypixie
Mon Oct 28, 2013 2:00 am
Forum: PHP coding => General
Topic: Insert record in PHP
Replies: 23
Views: 3439

Re: Insert record in PHP

I know that and my answers are exactly what you need to do - I don't understand the problem?
by simplypixie
Mon Oct 28, 2013 1:43 am
Forum: PHP coding => General
Topic: Insert record in PHP
Replies: 23
Views: 3439

Re: Insert record in PHP

In which case my first line of code to convert for the database should work unless the date is not being passed through correctly in the first instance
by simplypixie
Mon Oct 28, 2013 1:26 am
Forum: PHP coding => General
Topic: Insert record in PHP
Replies: 23
Views: 3439

Re: Insert record in PHP

Sorry, it is so long since I have formatted dates this way (i.e. without using the inbuilt php datetime class) that I forgot that if you use slashes in a date that strtotime will see it as a US date format and therefore will think your format of dd/mm/yyyy is actually mm/dd/yyyy and therefore return...
by simplypixie
Mon Oct 28, 2013 12:17 am
Forum: PHP coding => General
Topic: Insert record in PHP
Replies: 23
Views: 3439

Re: Insert record in PHP

You cannot store dates as dd-mm-yyyy in the database as the database date format is yyyy-mm-dd. Therefore you need to convert dates from dd-mm-yyyy to yyyy-mm-dd before you insert or update your db and vice versa to display the date in your required format when displaying. Based on the way you are c...
by simplypixie
Tue Oct 22, 2013 11:14 pm
Forum: PHP coding => General
Topic: Best way to show written date and some weekend rules
Replies: 0
Views: 723

Re: Best way to show written date and some weekend rules

This is what you need: <?php $date = date("l\, F j", strtotime("tomorrow")); $day = date('l', strtotime('tomorrow')); if ($day == 'Friday' || $day == 'Saturday' || $day == 'Sunday') { echo 'Monday'; } else { echo $date; } ?>
by simplypixie
Tue Mar 05, 2013 12:00 am
Forum: PHP coding => General
Topic: Help with this script
Replies: 0
Views: 664

Re: Help with this script

This error means you are missing a closing }. I found where it was but have combined your first 2 if statements anyway to save lines of code for you: if (isset($name) && !empty($name)) { if (($extension=='jpg'||$extension=='jpeg') && $type=='image/jpeg' && $size<=$max_size) { $location ='uploads/'; ...
by simplypixie
Mon Mar 04, 2013 11:49 pm
Forum: PHP coding => General
Topic: Php Echo Numbering
Replies: 2
Views: 1329

Re: Php Echo Numbering

You are nearly there. If you want the numbering to start at 1, change $i = 0; to $i = 1; and then chnage your echo to

Code: Select all

echo "<aside id='techSlide<?php echo $i; ?>' class='ic_container'>
by simplypixie
Sun Mar 03, 2013 12:58 am
Forum: PHP coding => General
Topic: Warning: mysql_num_rows() expects parameter 1 to be resourc
Replies: 0
Views: 725

Re: Warning: mysql_num_rows() expects parameter 1 to be reso

The error means that your query is failing (so there are no rows to count) so echo out your $sql and see what exact query it is trying to run on the database and make sure it is correct (if you think it looks correct then copy and paste into PHPMyAdmin and see what error you get there).
by simplypixie
Tue Feb 19, 2013 10:27 pm
Forum: PHP coding => General
Topic: Best way to generate transaction id for a point of sale appl
Replies: 0
Views: 1557

Re: Best way to generate transaction id for a point of sale

Code: Select all

$date = date('Ymd');
$numbers = '0123456789';
for ($i=0; $i<$4; $i++) {
		$rand_num.=$numbers{rand(0,strlen($numbers)-1)};
	}
$transaction_id = 'PO'.$date.''.$rand_number;
by simplypixie
Fri Feb 15, 2013 10:45 pm
Forum: PHP coding => General
Topic: referencing a variable from 1 php file to another
Replies: 11
Views: 2579

Re: referencing a variable from 1 php file to another

I presume you want to get the value selected from the dropdown menu, not just echo out the dropdown menu in future, in which case you don't assign the whole menu to a variable you just have the menu on your form and then get the valu posted from it. In the form: <select name="bagelT"><option value="...
by simplypixie
Thu Feb 14, 2013 11:30 pm
Forum: PHP coding => General
Topic: referencing a variable from 1 php file to another
Replies: 11
Views: 2579

Re: referencing a variable from 1 php file to another

Please read my post - I have explained it all for you.
by simplypixie
Thu Feb 14, 2013 12:39 pm
Forum: PHP coding => General
Topic: referencing a variable from 1 php file to another
Replies: 11
Views: 2579

Re: referencing a variable from 1 php file to another

In which case, to give you some guidance and an example. Firstly ensure that you have session_start(); declared at the very top of the page that you are using sessions on (this means before any other PHP or HTML code): <?php   session_start();   // Include or Require your external PHP files here as ...
by simplypixie
Wed Feb 13, 2013 11:30 pm
Forum: PHP coding => General
Topic: referencing a variable from 1 php file to another
Replies: 11
Views: 2579

Re: referencing a variable from 1 php file to another

It depends how you want to get them to page B. If page A has another form that is posted to page B then you can just put the variables in has hidden inputs in the form.

If you are not using another form then your only option is to use sessions. Do you need help on using sessions?
by simplypixie
Sun Feb 10, 2013 11:38 pm
Forum: PHP coding => General
Topic: Error in a column
Replies: 2
Views: 1704

Re: Error in a column

ychan20 - I have already told you a while back to check if the column exists in your database table :?
by simplypixie
Tue Feb 05, 2013 10:32 pm
Forum: PHP coding => General
Topic: HELPP!!!!
Replies: 5
Views: 1807

Re: HELPP!!!!

Sorry I don't understand your question, are you asking how to check your database?
by simplypixie
Mon Feb 04, 2013 10:28 pm
Forum: PHP coding => General
Topic: admin log in problem
Replies: 0
Views: 918

Re: admin log in problem

Firstly, I would suggest doing your security cleaning on the post data as you allocate it to variables so that for one you ensure your password is trimmed etc before it is changed to SHA1 and secondly it removes the extra lines of code. Plus stripslashes and strip_tags are not required as mysql_real...
by simplypixie
Mon Feb 04, 2013 10:03 pm
Forum: PHP coding => General
Topic: how to send variables
Replies: 0
Views: 831

Re: how to send variables

There are a few errors with your script 1. $_REQUEST is deprecated so shouldn't be used - use $_GET and $_POST instead 2. You can't just put html elements in the middle of PHP (i.e. you form), you need to close the PHP tags and re-open them again 3. When you send the page using your javascript it do...
by simplypixie
Mon Feb 04, 2013 9:45 pm
Forum: PHP coding => General
Topic: HELPP!!!!
Replies: 5
Views: 1807

Re: HELPP!!!!

Firstly, when posting code please put it in the Code container so it is easier to read (the button in between Quote and list). With regard to your error, you have a field name called landline_show in your insert query which basically doesn't exist in your database table, so check the name of this fi...
by simplypixie
Wed Jan 30, 2013 6:24 am
Forum: PHP coding => General
Topic: what is this "$" sign in echo $row ?
Replies: 9
Views: 2624

Re: what is this "$" sign in echo $row ?

Sorry I don't know what your question is. However, I would learn HTML first and then move to PHP they are 2 very different coding languages and you may just confuse yourself trying to learn both at the same time.