veedeoo 474 Junior Poster Featured Poster

Hi,

For this

<select name="birdname"><option value="<?php echo $row['bird_id'] , $row['name']?>">

I would $_POST it first to get the value from the <option>, and then explode it by " ' "

Something like this.. codes below are example and should be modified, before implementing to production server..

$bird_name_id = $_POST['birdname'];
## when posted the value of $bird_name_id is something like this name , id 
## this is where we need to use the explode function or any handy php function available.. your choice.
$new_data = explode(",", $bird_name_id);
$birdName = $new_data[0];
$birdId = $new_data[1];
veedeoo 474 Junior Poster Featured Poster

Hi,
Just a humble question from me :)...I thought when using the RecursiveIteratorIterator class goes by this pattern

$the_iterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($some_arr));

So, by looking at your codes, I assumed that your are trying to filter the $the_iterator by RegexIterator which is obviously are images.

on your codes, the array is this one

('../Home'

Is it just a place holder?, or this is what you are trying to run with the script?


JUst asking, maybe I can learn something new from this thread :)

veedeoo 474 Junior Poster Featured Poster

@subrata_ushasi,

jUst my humble opinion, I think it will be a lot easier to run it on xampp.

1. Download xampp from apache and friends . Select the zip file
2. Unzipped file and then move the xampp directory to your thumb drive. Unless you will be running an ffmpeg, mencoder, flvtool2, mp4box, php applications, then xampp must be installed in the c drive just like any other program. For all ecommerce and blog applications, these can run on the thumb drive. Which I think is pretty handy.

3. Explore thumb drive, and look for xampp directory.
4. Click on the xampp start.. do not close the command prompt window, while the xampp server is running.
5. Direct your browser to localhost
6. On the left column of the page click phpmyadmin.

7. On the phpmyadmin page move your cursor to the right column and look for the "database" tab, click on the "database" tab. Create a database for your magento installation.

8. After creating the database, click on the "privilege" to add new user if there is no predefined user "root" in there. Normally it has a root with ALL privileges on it already assigned. Otherwise, a new user must be created..

9. Use the database credentials to setup magento.

veedeoo 474 Junior Poster Featured Poster

Wow, can you please give us more explanation on what you are trying to achieved here.

I thought when you do this;

INSERT INTO `YourTable`(`col-1`, `col-2`, `col-3`) VALUES ("",[value-2],[value-3])

That should give you an empty value for the col-1.. or you can set the table null -> Yes and then default -> NULL .

veedeoo 474 Junior Poster Featured Poster

>> you need to have root access on your server..
>> Connect to your server, using Putty or depending on your OS if you are running Ubuntu as your os, just open your teminal.

>> Login using the terminal and follow the freeswitch wiki.

>> Most servers are based on linux and unix, so it will be easy for you to do it behind terminal (black box).

veedeoo 474 Junior Poster Featured Poster

Dude, you are posting the same question twice already this one and here.

veedeoo 474 Junior Poster Featured Poster

try searching for free available services. Google is our friend..

Writing an application like this takes time. But if all you need is a raw flat file based chat script... I can probably show you how, but it is no guarantee when I could do this, because of my time constraints. I am just too busy with my schooling right now. Just hanging out here posting response on easy questions.. :)

veedeoo 474 Junior Poster Featured Poster

You need to install EITHER one ->> Xampp, LAMP, or EasyPHP on your windowsXP environment.

veedeoo 474 Junior Poster Featured Poster

Yes, it will be in the dropdown.

veedeoo 474 Junior Poster Featured Poster

Hi,

Try adding a new column and name it role.. and then it is all up to you how are you going to assign values to sort between teacher and student.

For example, if we are to give an integer 7 for the role of teacher and a value of 1 for student, then we can easily sort their privileges and page access..

Sample query..

$query = "SELECT * FROM TableName WHERE title='".$title."' ";
## pull out the result as $row


## then check for the role

if($row['role']== 7){
## label this member as teacher. You can store this in session
$isTeacher = true;


## this user must be a teacher
## redirect this member to the teachers only page
}
else{
$isStudent = true;

## this member must student
## redirect this member to students only page

}

You can also expand the members privs, by adding more role valu e.g. 8, 9, or better yet make a triple digits like 100 for students, 700 for teachers, 900 for supervisors, and others.

Notice I define $isTeacher = true;?, you can put this in session, so that it is a lot easier for them to browse across the site without having to re-validate their role..

Example

if($isTeacher){
## if true then this member will only see menu or pages applicable to teachers only

}
veedeoo 474 Junior Poster Featured Poster

Hi,

Can you please give us more detail.. to sort your array, you can easily do this by and it will give you an ordered dates regardless if you put 01/20/2012 in front of the array.

$dates_ar = array('01/01/2012','01/20/2012','01/02/2012','01/03/2012','01/05/2012','01/10/2012');
sort($dates_ar);

## we can echo
foreach ($dates_ar as $date => $val) {
    echo "Dates[" . $date . "] = " . $val . "\n";
}

If you want to find the earliest date and the last date within the array, then you can do something like this..

$dates_ar = array('01/01/2012','01/20/2012','01/02/2012','01/03/2012','01/05/2012','01/10/2012');
## first we sort the array above to make it in order
sort($dates_ar);
## we need to find out how many items are in the array.
## I am assuming here that the array[0] is the earliest
echo count($dates_ar)."<br/>";

## now we know how many date entries in the array, we need to pick up the last
$numb = (string)(count($dates_ar)-1);
## first date of the array
echo $dates_ar[0]."<br/>";

## the last date of the array
echo $dates_ar[$numb]."<br/>";

You can even evaluate, can convert dates to unix or whatever is needed for you to find/calculate range. The above is just a simple example from many possibilities.. It is all about how you will apply the logic that you have in your mind. It is all logic :).

veedeoo 474 Junior Poster Featured Poster

here is the demo using the same script as above. The only difference is that the demo is going to someDomainDot/search/tags.. Which is pretty similar to what you are looking for. By the way.. , the demo is the old version of my open source re-release version of vidiscript youtube clone script..My latest release is way much better than that...

veedeoo 474 Junior Poster Featured Poster

Hi,

Here is my humble contribution using FETCH_CLASS PDO object.. I posted this as a response in one of the question weeks ago. I brushed it up a little to become relevant to your question.

<?php
class User{
## Property declaration NOTE! All these variables or properties are the column names of table user
public $name;
public $lastname;
public $username;
public $hobby;
## end of property declation

## YES! NO! we are not going to have a __construct this time.. we will be passing this class to our pdo object

public function show_userInfo(){
## The following will be output on the page once the PDO statement is fetched.
$u_info = "";
$u_info .= 'Name: '.$this->name.'<br/>';
$u_info .= 'Lastname: '.$this->lastname.'<br/>';
$u_info .= 'Username: '.$this->username.'<br/>';
$u_info .= 'Hobby: '.$this->hobby.'"/><br/>';
 return $u_info;
 
 ## end of function show_userInfo()
}

} 
## settings.php is a file where the database user, password, and db name is located.
## they are defined as follows; $db_host = "localhost";$db_user = "username"; $db_password = "db password";$db_database = "dbName";
include_once 'includes/settings.php';

#### The PDO objects ###############
try {
    $someDb = new PDO("mysql:host=$db_host;dbname=$db_database", $db_user, $db_password);
    ## Say Hi to Morpheous and Neo, if we are connected
    echo 'Hi, Morpheous and Neo!<br />'; // remove this just trying to amaze myself.

   ## define our connection query
   $query = "SELECT * FROM users WHERE userID= '".$u_id."'";

    ## prepare to fetch PDOStatement objects 
    $pdo_Object = $someDb->query($query);
	
	## comment two lines below if you don't need to show count of affected rows.
    $count = $pdo_Object->rowCount(); …
veedeoo 474 Junior Poster Featured Poster

holli macaroni! :).. I forgot the explode function..

jUst place these codes where appropriate.

$tags = explode(',', $row['tags']) ;

remove the , and then trim

$tags = trim(str_replace(",", "", $tags)) ;
veedeoo 474 Junior Poster Featured Poster

Hi,

Try this script... I derived this from the tag cloud script I wrote when I was a newbie. This is my very first tag cloud script, and the very first time that I wrote a function.. The original script was pretty good. It almost took me forever trying and experimenting with arsort, ksort and many other stuffs related to array.

There you have it..

<?php
## define the the following
$db_host = "";
$db_user = "";
$db_password = "";
$db_database = "";

## endo of all definitions ##

mysql_connect($db_host, $db_user, $db_password) or die(mysql_error());
mysql_select_db($db_database) or die(mysql_error());

function tag_info() { 
## change items  [ ] to your database table and column  .
  $result = mysql_query("SELECT * FROM [YOUR_TABLE ] GROUP BY [tags]  "); 
  while($row = mysql_fetch_array($result)) { 
    $arr[$row['tags']] = $row['tags'];
  } 
  //ksort($arr); 
  return $arr; 
}

function tag_link() {

## define your domain here or the link url
$link_url = "home";
    $tags = tag_info();


    $tag_html = '';
    $cloud_tags = array();

    foreach ($tags as $tag) {
     
        $cloud_tags[] = '<a class="tag_link" href="'.$link_url.'/' . $tag.'.html" title="\'' . $tag  . '">'. htmlspecialchars(stripslashes($tag)) . '</a>';
    }
    $tag_html = join("\n", $cloud_tags) . "\n";
    return $tag_html;

}

print tag_link();
?>
veedeoo 474 Junior Poster Featured Poster

cool.. :)

veedeoo 474 Junior Poster Featured Poster

Hi,

These codes

$sql="SELECT * FROM $tbl_name WHERE invoice_no = '$invoiceno'";
$result=mysql_query($sql,$dbh1);
$row=mysql_fetch_array($result) or die(mysql_error());
echo "$row";

Shouldn't be a lot easier to find if rows is greater than zero?

Something like this

$sql="SELECT * FROM $tbl_name WHERE invoice_no = '$invoiceno'";
$result=mysql_query($sql,$dbh1);
$row= mysql_num_rows($result) or die(mysql_error());
echo "$row"; 

## check on the result
if($row>0){

## do your thing here

}

Do the same on the second database..

veedeoo 474 Junior Poster Featured Poster

Hi,

You can use the unix time if you want. Normally, more people are using this because the chance of duplicates is somewhat pretty rare. Think about having two people clicking the same button at the same time .

You can use like this

$time_posted = $time();

You can then use the $time_posted to be saved in your database.. Usually, you would get something like this 12674916644 bunch of numbers.

If you want to show it on the webpage as readable date and time, all you have to do is to convert back to its original form, before it became unix. Like this

echo date('l jS \of F Y h:i:s A', $time_posted);

You can also calculate the time since it was posted by using the current time as reference like this

## time elapsed since it was posted
$time_elapsed = (time() - ($time_posted));

echo $time_elapsed;
veedeoo 474 Junior Poster Featured Poster

Hi,

Many ways to achieve this... some people in smarty community where I used to hangout a lot, they were using an xml for translation, while others uses a module of which I can't even remember its name.

Another common method is the direct translation for example,

create a language dir, and then inside the language dir create language name directory. e.g. language/en language/icelandic . Now for the php language page..

save this as en.php

$lang['home'] = "home";
$lang['comments'] = "comments";

create a test.php

require_once 'language/en/en.php';

## echo the translated item
echo $lang['home'];
echo "<br/>";
echo $lang['comments'];
echo "<br/>";

Direct your browser to test.php.. it should print home and comments.. now create another file and name it icelandic.php. translate the words in double quotes to the icelandic language. Change the require_once 'language/en/en.php'; to the icelandic directory. Direct your browser to the test.php. The page should be showing the translated language.

To change the language you can use $_GET to capture the viewers language selection, and then put it in session..

veedeoo 474 Junior Poster Featured Poster

Hi,

Before anything else, can you please check what is the value of your upload_max_filesize and post_max_size. These are in the php.ini file or on your loaded server configuration file.

I also suspect that your server's php version has been upgraded..

Just copy, save, name anyNameYouWant.php, upload to your server, and then direct your browser to this file. Look up for the values of those items I have mentioned above.

<?php 
phpinfo(); 
?>

Another question I have, what do you do with the video extensions not supported by flash player? Is it encoded? If yes? by What?

about the deprecated function, Ardav already corrected it on his proposed solution

$exts = split("[/\\.]", $filename) ;

Was replaced by this

$f = pathinfo($filename);

Or you can use one of my favorite

## derived from your function above
function findexts ($filename)
{
$filename = strtolower($filename) ;
$exts = strtolower(substr($filename, strrpos($filename, '.') + 1));
return $exts;
} 

## testing the function above.. it should return flv
$some_file = "somevideo.flv";
echo (findexts($some_file));
veedeoo 474 Junior Poster Featured Poster

Hi,

You only use countryCode[0], when there are multiple countryCode .

for example,

<?xml version="1.0" encoding="UTF-8"?>
<Response>
<statusCode>OK</statusCode>
<statusMessage></statusMessage>
<ipAddress>2.99.203.40</ipAddress>
<countryCode>UK</countryCode>
<countryCode>UK1</countryCode>
<countryCode>UK2</countryCode>
<countryName>UNITED KINGDOM</countryName>
</Response>

If I want to parse the coutryCode for UK, my script should be something like this.Assuming that the above file is named xml.xml.


!ADDED LATER ON EDIT!

$xml = "xml.xml";
$xml = @simplexml_load_file($xml);

foreach($xml as $items){

$country = $items->countryCode[0];

echo $country;
}

If you need more example, please visit my previous posts in this forum... I got a lot about xml parsing.

veedeoo 474 Junior Poster Featured Poster

If I can help you, can I at least get a free Bus pass? Where is this place though? :). If it is too far from Princeton, New Jersey, it's ok :).

Stop punishing your fingers by typing these

<select name='dep_day'>
<option>Day</option>
<option value='1'>1</option>
<option value='2'>2</option>
<option value='3'>3</option>
<option value='4'>4</option>
<option value='5'>5</option>
<option value='6'>6</option>
<option value='7'>7</option>
<option value='8'>8</option>
<option value='9'>9</option>
<option value='10'>10</option>
<option value='11'>11</option>
<option value='12'>12</option>
<option value='13'>13</option>
<option value='14'>14</option>
<option value='15'>15</option>
<option value='16'>16</option>
<option value='17'>17</option>
<option value='18'>18</option>
<option value='19'>19</option>
<option value='20'>20</option>
<option value='21'>21</option>
<option value='22'>22</option>
<option value='23'>23</option>
<option value='24'>24</option>
<option value='25'>25</option>
<option value='26'>26</option>
<option value='27'>27</option>
<option value='28'>28</option>
<option value='29'>29</option>
<option value='30'>30</option>
<option value='31'>31</option>
</select>

All dates, months, and years should be written in php like this

<?php
## you may want to write simple php function to get the number of days for the month
$days_ofMonth = 31;
echo '<select name="dep_day"/>';
for($dep_day = 1; $dep_day <= $days_ofMonth; $dep_day++){
?>
<option value="<?php echo $dep_day;?>"><?php echo $dep_day;?></option>
<?php
}
echo '</select>';
?>

You can focus more on your programming than typing identical numbers. Let the php work for you.

Biiim commented: helpful +4
veedeoo 474 Junior Poster Featured Poster

This is our point of interest

<select name="select" id="select">

Process the form by either GET or POST

## grab the selected aution id
$a_id = $_POST['select'];

$query1 = "SELECT * FROM auctions WHERE auction_id = '".$a_id."'";
$result1 =mysql_query($query1,);
while ($row=mysql_fetch_array($result1)) {

## echo item title description, and all other stuffs
echo $row['title'];
}

That's all..

veedeoo 474 Junior Poster Featured Poster

Just a minor correction with the codes..

find line 14

if (isset($_POST['submit']))

change to

if ((isset($_POST['submit'])) && ( (isset($_POST['pica10'])) || (isset($_POST['pica14'])) ||(isset($_POST['pica18']))))

That should take care of the form being submitted without a tick. Now, we have added another php operator used in the script. && (AND) and the || (double pipe or OR)

veedeoo 474 Junior Poster Featured Poster

please do not hesitate to change this and the rest of your pizza sizes..

if(!empty($_POST['pica14']))

to

if(isset($_POST['pica14']))

or

if($_POST['pica14'])

it won't matter, because everything are wrapped in the if isset clause.

veedeoo 474 Junior Poster Featured Poster

Hi,

I don't have the chance to test my codes below, because I am also busy at school.. NOOO it is not about programming. It should give you what you are trying to make.

PHP functions use in this script.. just in case your professor ask you.. empty(), $_POST, for loop, if/else, and mathematical operators addition, multiplication and !not.

<?php
## A simple pizza delivery system Written 

## layout our pizza options
 # define your maximum quantity inside the select option
 $max_q = 10;
 # define your pizza prices 
 $small = 300;
 $medium = 450;
 $large  = 650;
 
## first we detect if the submit button has been submitted, if not we show our client the form

if (isset($_POST['submit'])){
## the following prevent undefined error beyond the php 5.2.X versions.
$s_quant = "";$m_quant = "";$l_quant = "";$s_cost = "";$m_cost = "";$l_cost = "";
 ## process the form. What matters here the most is to know if the checkbox is ticked
 ## process small pizza if it is tick.
 if(!empty($_POST['pica10'])){
 $s_quant = $_POST['sq'];
 echo "<b>Small pizza</b><br/>Quantity: ".$s_quant."<br/>";
 ## always wrap var for mathematical calculation with parenthesis
 $s_cost = ($small) * ( $s_quant);
 echo "Price: ".$s_cost."<br/>";
 }
 if(!empty($_POST['pica14'])){
 $m_quant = $_POST['mq'];
 echo "<b>Medium pizza</b><br/>Quantity: ".$m_quant."<br/>";
 ## always wrap var for mathematical calculation with parenthesis
 $m_cost = ($medium) * ( $m_quant);
 echo "Price: ".$m_cost."<br/>";
 }
 if(!empty($_POST['pica18'])){
 $l_quant = $_POST['lq'];
 echo "<b>Large pizza</b><br/>Quantity: ".$l_quant."<br/>";
 ## always wrap var for mathematical calculation with parenthesis
 $l_cost = ($large) * ( $l_quant);
 echo "Price: ".$l_cost."<br/>"; …
veedeoo 474 Junior Poster Featured Poster

Do you know if it's possible to do that with EasyPHP as well? EasyPHP looks like a good local web server. Or is Xampp better?

Either one will make your development a lot easier... you can spend more time writing codes than trying to figure out your server configurations.

I am also using EasyPHP.. it all depends on what you are trying to write. If you will be developing an application in which ffmpeg, mencoder, mp4box, and flvtool2 are needed to be executed by the php script, then xampp is more flexible and accommodating for this type of applications.

Outside the youtube like development, I think EasyPHP got the upper hand, because it has more modules to offer for the most commonly develop applications such as joomla and presta shop ( I worked on some of modules and extension for this), just to name a few.

veedeoo 474 Junior Poster Featured Poster

When using the script above... just correct my improper used of php shorthand

<?=$thumbs?>

should be

<?php echo $thumbs; ?>

Sometimes, I am posessed by AERGIA the goddess of laziness :)

veedeoo 474 Junior Poster Featured Poster

Hi,

I can explain it in simple words without too many comments needed

The Input ---> The Processing of the Input ---> The output or the outcome of the processed input.

In short,

Controller(input) --> model(processing) --> View(output or template)..

Sample script
Controller

## checks if members logged in

$isLogged_in(){
## can instantiate class here

}

## if not logged show the form
## or make sure to offer registration

model

## process the data triggered by the controller
## registration and others
## in other words this will check username against the members in the database
## or will insert new members to the database

View

## show the output
## show content to the logged_in and to not logged_in

## if Smarty templating is included, then this is where the smarty assign takes place.
veedeoo 474 Junior Poster Featured Poster

Another suggestion, you can use xampp which is already pre-configured to run mysqli, pdo.

Xampp can and will also run from portable drive..

A simple portable drive xampp installation
1. Download xampp for your OS
2. Extract zip file contents to your portable drive.
3. Open portable drive, look for the xampp_start.exe to start the service.

That's all you need to do. Everything are pre-configured for you. Just dump your php script in the htdocs directory.

veedeoo 474 Junior Poster Featured Poster

Hi,

The linked is based on zend extension.. If you have not work with zend framework before that would be very tricky.

If you just need the same functionality as zend without breaking the peggy bank, thene consider the following codes. I posted these codes on my previous post in this forum..

<?php
## script was written by PoorBoy from veedeoo.com/forum
## no warranty of any kind, so please don't even bother asking
## Can help during my freetime, but still no guarantee.
#### First we need a function fot get youtube video id
function getPatternFromUrl($url)
{
$url = $url.'&';
$pattern = '/v=(.+?)&+/';
preg_match($pattern, $url, $matches);
//echo $matches[1]; die;
return ($matches[1]);
}
## function above we will use later

## define our query for youtube
$query = "ac+dc";
## define the order by published or viewCount
## viewCount is case sensitive
## you can also do the publisher or author only, read the youtube API about this
$order ="published";
## define start index. Youtube allows you query 50 videos per page, but no more that 1000 per $query
## lets define start index to be 1 . Depending on the result of the query this should return at least 1000/50 = number of pages 
$s_page = 1;
## let's define the number of results we want to show on the page
## Like I said above max is 1000 and it is break down into 50 videos per $s_page.
$nvideos_max = 50;
## define format type format 5 …
veedeoo 474 Junior Poster Featured Poster

Hi,

The sample script I have provided you is just a sample on how to do things roughly. However, you need to write a simple programming flowchart of how the pizza orgering process may take place, and then based on this flowchart, you can create the php codes. We cannot make the flowchart to bend around the php codes. It has to be the other way around.

Here is a simple flowchart for the pizza ordering system.
1. Client is presented with the form
2. Client select items and quantities on the form selection
3. Client submit the form

The processing php file for the above, could be something like this
1. Check if the form is submitted and not empty
is form enpty? ->make the client know
is form not empty? -> process the client's input by way of either get or post
2. Filter the processed data from the client's input
condition One: Which pizza size is selected?
Condition two: how many pizza of this size has been selected?

3. Create a switch where we can monitor the clients selections.. Meaning if the client wants 3 small, 2 large, and 7 medium pizza, we are able to process the form.

4. Present the client with the summary of the order.


So, what I want to see in your codes is something like this

if(Small pizza quantity > 0){

## do your …
veedeoo 474 Junior Poster Featured Poster

Hi,

The sample script I have provided you is just a sample on how to do things roughly. However, you need to write a simple programming flowchart of how the pizza orgering process may take place, and then based on this flowchart, you create the php codes. It is not the other way, making the flowchart bending around the php codes. It has to be the other way around.

Here is a simple flowchart for the pizza ordering system.
1. Client is presented with the form
2. Client select items and quantities on the form selection
3. Client submit the form

The processing php file for the above, could be something like this
1. Check if the form is submitted and not empty
is form enpty? ->make the client know
is form not empty? -> process the client's input by way of either get or post
2. Filter the processed data from the client's input
condition One: Which pizza size is selected?
Condition two: how many pizza of this size has been selected?

3. Create a switch where we can monitor the clients selections.. Meaning if the client wants 3 small, 2 large, and 7 medium pizza, we are able to process the form.

4. Present the client with the summary of the order.


So, what I want to see in your codes is something like this

if(Small pizza quantity > 0){

## …
veedeoo 474 Junior Poster Featured Poster

Hi,

On your extension directory, look for the .dll files. Make sure that you are editing the php.ini file from the loaded configuration file.

If this does not work for you, then you must set the cofig file to php/php.ini, and then you copy the .dll files from the php5.3.9/ext/ dir to php/ext directory.

You should have a .dll file named php_mysql.dll in there.,

Depending on your OS, if running on window (all versions) the server configuration file is located in apache/conf directory. For the ubuntu and other distros powering desktops the configuration file is located in etc directory.


Don't forget to restart your server everytime entries are modified...

veedeoo 474 Junior Poster Featured Poster

@INF-P,

Biiim is correct.. The work of other developers needs to be analyze, and then study their script progression. This is even complex and takes a lot of time if procedural programming is used, because the php codes are all over the place.

While in the object oriented programming, the majority of the core script is located in fewer class files. So, finding whatever we are looking for is less tedious than finding it from the procedural.

Ok the next one is to make sure there are no other associated files to the files you have presented us. What I meant by associated files are the files in template directory if ever exist, admin/index.php or whatever file responsible for showing the page to the browser.

PLease Ignore my comments below! Just my own humble opinion and should be considered as such.

For all aspiring coders who want to become a developer later on, this is the environment where the OOP, PDO, and templating system is needed and can easily thrive. Most people would disagree and will continue to stand by the reasoning of "Why learn OOP and templating language if they already know procedural programming pretty well".

I do understand the logic behind it, why learn another language if php alone can somehow mimic the same templating system results? However, carriers and believers of this logic, should also consider the scenario of running a much complex script such as shopping cart like the subject …

veedeoo 474 Junior Poster Featured Poster

Hi,

Can we take a look at the field_list.php, this file may contain some function. I think you already find part of the file you are looking for.


I need to take a look at it tomorrow though.. It is now pretty late in my time zone... need to hit the bunk...

SIDE NOTES:

The price is this -> ppric='".$_POST

veedeoo 474 Junior Poster Featured Poster

Hi,

Where is your updateinfo.php?

veedeoo 474 Junior Poster Featured Poster

Hi,

Basket is the shopping cart itself. Look for the admin directory if there is one, and then maybe just maybe inside that directory look for product.php, or edit.php, addproduct.php something that is related to product editing..


All we need to know is the price format the previous developer used. Normally, people would use 4.00 for $4.00 dollars, but then again some would not go for that format because of the currency of the default country.

I am pretty sure the file is just being tucked away... I am definitely sure it is located in the administrator or store owner directory only.

veedeoo 474 Junior Poster Featured Poster

Hi,

I did this type of testing in Paypal sandbox, too many times already. BUT, not to offend you or anything, can you please put your codes between the CODE tags. Then only that time when you did that, I will help you.. It gives me a terrible head ache looking at the codes that way..

veedeoo 474 Junior Poster Featured Poster

Now for the answer to your question. Your codes above is for product search query.. You need to look for something like INSERT , or UPDATE ..

Looking at the previous developer's coding pattern, it is more likely that his insert query would be something like this

$query = "INSERT *              ";

## or
$query = "UPDATE *              ";

scan your script files and find for those entries or better yet search for the database table's column for the price.

To make your life a lot easier, use NetBeans IDE, and then load your entire scripts as new project.., and then use the search function of the NetBeans while your script is loaded as project.

veedeoo 474 Junior Poster Featured Poster

Hi,

jUst a friendly advice.. next time, enclose your codes with the code tag located on top of the editor.

It is a lot easier to red codes this way..

karthik_ppts commented: Yes +7
veedeoo 474 Junior Poster Featured Poster

Hi,

Do you mean text link to submit the form? Actually, you can use images if you want. We cannot accomplish this by using PHP. It has to be javascript.. I was going to advice you to post your question in the javascript forum, but I figured out the codes for it is pretty short. So, I guess I have to give it a try..

<!-- you can put the javascript anywhere in the page.. this is not one of those has to be on the head, better yet put it just above the body closing tag -->
<script type="text/javascript">
function submit_thisform()
{
    document.forms["this_form"].submit();
}
</script>

<!-- here is our form with the id = this_form -->
<form id="this_form" action="" method="post">
<input type="text" name="input1" value=""/>
<input type="text" name="input2" value=""/>

</form>
<a href="javascript: submit_thisform()" >Submit This Form </a>

there you have it :)..

veedeoo 474 Junior Poster Featured Poster

Hi,

You can add two columns in your customer's table. One is for temp_password, and second is for the temp_passAge. We can then use time as comparator for the time elapsed since the temp password was created.

Example:

## assign server time to ctime
$ctime = time();
## you may want to add your query here like
$username = $_POST['username'];
$temp_password = $_POST['temp_pass'];

## then the actual query
$query = "SELECT * FROM 'customer' WHERE 'temp_password' = '".$temp_password."' ";

## grab the result here in loop

while( $row = whatever here ){
## take the values

$password_age = $row['temp_passAge'];

## subtract current time from the password age 
$time_e = $ctime - $password_age;

## set your expiration in seconds
$pass_expire = 2400; ## this is in seconds

## set your conditions for whatever
if($time_e >= $pass_expire){

## the password expired

echo "Your Password Expired";

## provide link to whatever page needs to handle this event.
}

else{

echo "Your Password is good";

## show form to update password

## do database update on the user's password

}
}

I prefer doing this on this part of the code

else{
 
echo "Your Password is good";
 
## show form to update password
 
## do database update on the user's password
$password_ok = true;
}

Then just build your response and processes based on the true or false. So, that you don't have to put too many stuffs inside the while loop..

veedeoo 474 Junior Poster Featured Poster

try this..

copy, paste to notepad, save as anyNameYouWant.php, upload to your htdocs .

<?php phpinfo(); ?>

Direct your favorite browser to anyNameYouWant.php, and look for Loaded Configuration File , or Configuration File (php.ini) Path

Now the fun part, look for the location of the php.ini file and edit it.. For example, wamp/php/php.ini .However, your case might have a different location, because you already stated above you already edited the php.ini file inside your php directory.

veedeoo 474 Junior Poster Featured Poster

Hi,

It is getting really late in my time zone, that I really need to hit the bunk. Anyways, here is the general form for xpath in php..

I am not going to explain it in great detail, but the whole idea is well presented.

<?php
$xml = simplexml_load_file("../category.xml");

$cat_name = $_GET['category'];

## uncomment $cat_name below to test

//$cat_name = "Civil Works";

$result = $xml->xpath("category[subject='".$cat_name."']/name");

foreach($result as $name){

## echo the name of the matched
echo $name."<br/>";
}
?>

If run the script above, it should give you "Engineering" as a match from the nodes. Just expand the script above to your requirements.

veedeoo 474 Junior Poster Featured Poster

cool, just in case sales tax needs to be included. I overlooked the calculation for the total amount due it should read

echo "Must Pay ".( $total_AmountDue + $gross_AmountDue)." Immediately, or else I will eat these Pizza";
veedeoo 474 Junior Poster Featured Poster

Hi,

If the id is coming from auto increment, then it would be difficult to guess which is which. I know it is easy if you are looking at it, but programatically it will be difficult for the script. I mean you can do >22, but that is not the proper way.

You will have to add another column on your table to serve as switch. For example, we can add a column named "status" and this column can have a value of either true or false. This way you can set it to false whenever it is needed using the "task" as parameter. We can filter your data like SELECT * FROM 'table' WHERE status = 'true'. Not only that, we can also set the status to true and false whenever it is needed.

veedeoo 474 Junior Poster Featured Poster

Hi,

It all depends on server configuration. You will need to find out these configurations by using the codes below.

Save as anyfileYoulike.php

<?php phpinfo(); ?>

Upload to your server and direct your browser to this file. Look for the value of Server API . If your server says CGI or FAST CGI, then you need to make those entries on php.ini file. Meaning, you can create a new file and name it as php.ini, and then upload it to your server. It could be either in the same level of the directory needing the increase in max_filesize or above it.

Here is the content of your php.ini file

upload_max_filesize = 50M
post_max_size = 50M
max_execution_time = 500
max_input_time = 500

If your server API says, Apache 2.0 Handler , apache module or anything about apache, then your .htaccess file should look like this

php_value upload_max_filesize 50M
php_value post_max_size 50M
php_value max_execution_time 500
php_value max_input_time 500

Remember to check what is on your phpinfo() first.. normally your upload_max_filesize would show 8M and not 8Mb...

WARNING! You CANNOT use BOTH.. ONLY ONE mUST be selected.. CGI or Apache...

R.Manojkumar commented: Thank your very much, problem solved brother +0
veedeoo 474 Junior Poster Featured Poster

ok,.. please do me a favor.. Run your script one more time.. Try to create a new user. On your server, check if a directory named after the new user is created. Also, you may want to check if the index.html exist in that directory.


I suspect that php copy function is might be faulty on your server side, but this is just one of the test we need to make in order to isolate where the problem is coming from. If everything is well, then we can go back to tackling the redirection problem.

veedeoo 474 Junior Poster Featured Poster

what i am trying to make it work like is this :

user enter the form details -> folders are created accordingly -> files are copied to the created folders -> redirection to one of the copied file

ok, now all of us are looking at the bright picture. Sometimes, going into the basic of flow charting helps..

On your codes where it says

$variable = 'uploads/'.$contact_name.'/'.$contact_name.'.txt';

While you are redirecting your user to

uploads/$contact_name/index.html

Shouldn't be these codes?;

$handle = fopen("$variable",'w');
fwrite($handle, "<hr>".'<b>'.'<u>'.'Name:'.$contact_name.'</u>'.'</b>'.' says:'.'<font size="1" >'.'<br />'.'on '.date("l, F d, Y ").'</font>'."\n");
fwrite($handle,"<br />".'<!--'.$contact_email.'-->');
fwrite($handle,"<br />".'<!--'.$contact_text.'-->');
fwrite($handle, "<br />");
fclose($handle);

be changed to

$variable = 'uploads/'.$contact_name.'/index.html';
$handle = fopen("$variable",'w');
fwrite($handle, "<hr>".'<b>'.'<u>'.'Name:'.$contact_name.'</u>'.'</b>'.' says:'.'<font size="1" >'.'<br />'.'on '.date("l, F d, Y ").'</font>'."\n");
fwrite($handle,"<br />".'<!--'.$contact_email.'-->');
fwrite($handle,"<br />".'<!--'.$contact_text.'-->');
fwrite($handle, "<br />");
fclose($handle);

Why these changes? Because we cannot redirect your user to something that may not exist in the uploads/$contact_name/


If you still want to redirect your user to the actual text file created by your script, then the redirection codes should be

'uploads/'.$contact_name.'/'.$contact_name.'.txt';

This will take your user to the text page view or review the processed data.