|
All,
I am working in PHP with Zend Framework. while i am trying to log in, i am getting the error as below,
Fatal error: Call to undefined function mcrypt_get_iv_size() in /var/www/html/sample/application/controllers/BaseController.php on line 52
How can i fix this issue?.
Any idea please.
Regards,
Periyasamy.R
modified on Friday, December 3, 2010 4:50 AM
|
|
|
|
|
<b>Getting Started with InstallShield Automation and Perl</b>
It's true, even Windows users succumb to the allure of extensibility and readability of Perl. Some even opt to use it to automate the build processes of their products and associated installers.
But, there's a problem. The InstallShield Help Library generally provides examples in the most ubiquitous Windows scripting language -- VBScript. The idea behind this is that working with COM Objects and Collections will be specific to the language in question, and that the core ideas behind the VBScript samples will apply to each in a very similar fashion.
While this indeed does hold to be true, it can be daunting if you are suddenly tasked with writing a script from scratch. Below are some of the VBScript examples from the InstallShield Help, translated to Perl.
read the blog at <a href="http://blogs.flexerasoftware.com/installtalk/2010/12/getting-started-with-installshield-automation-and-perl.html">http://blogs.flexerasoftware.com/installtalk/2010/12/getting-started-with-installshield-automation-and-perl.html</a>[<a href="http://blogs.flexerasoftware.com/installtalk/2010/12/getting-started-with-installshield-automation-and-perl.html" target="_blank" title="New Window">^</a>]
|
|
|
|
|
What's a best way to create breadcrumbs in a site? Well i know the process but the problem is the site pages are not structured in best possible way - there is no sitemap and all.
Thank you
|
|
|
|
|
I have used a mapping table with a structure like so
id page parent
1 index 0
2 about 1
3 products 1
4 cars 3
5 trucks 3
and so on...
I can then code some logic to build a breadcrumb dynamically based on the page name I am on.
Simply reference the parent until you get to a 0 with a 0 representing the top level menu.
so for example if someone is on page trucks the code will step over the rows in this order
5 trucks
3 products
1 index
build this in a string using a left to right order
first pass:
$bc = "/"."trucks";
second pass:
$bc = "/"."products".$bc;
third pass:
$bc = "/"."index".$bc;
of course you will want to add links instead of plain text.
You can also pregenerate the breadcrums and store those if your site is not very dynamic and you have control over the input of new pages.
Hope that helps.
Chris J
|
|
|
|
|
thanks for your input but what to do about the links? I mean there will be 100s of links. So according to your solution i should have another coloumn with link to each page which is cumbersome task i think ?
Or do you have another solution for that ?
Thank you
Andyyy
|
|
|
|
|
you could build your table dynamically, i.e. have each page add itself to the table. something like:
$myURL=$_SERVER["REQUEST_URI"];
AddPageToPageTable("shortNameSeenInBreadCrumb", "MyParentsShortName", $myURL);
Obviously all (non-leaf) "shortNameSeenInBreadCrumb" should be unique, the method should avoid duplicates, and would have a problem when it doesn't find the page's parent in the table already.
|
|
|
|
|
id page parent
1 index 0
2 about 1
3 products 1
4 cars 3
5 trucks 3
If you name the lookup the same as the real page minus the extension you can build any part of the pathway dynamically.
You will need an array to keep track of the full path at each part of the breadcrumb.
so the array would need to look like this
<?php
$bc_arr = array();
$depth_guage = 0;
$home_not_found=true;
$cur_pg_name = "";
while($home_not_found)
{
$sql = "select pr1.*, (select pr2.page from page_relations as pr2 where pr2.id=pr1.parent) as parrent_name, (select pr2.parent from page_relations as pr2 where pr2.id=pr1.parent) as grandparent from page_relations as pr1 where page='".$cur_pg_name."'";
$rst = mysql_query($sql) or die(mysql_error();
$row = mysql_fetch_row($rst);
if($row['grandparent']==0)
{
$home_not_found=false;
}
else
{
}
array_push($bc_arr,"<a href='".str_repeat("../",$depth_guage).$row['page'].".php'> > ".$row['page']."</a>");
$depth_guage++;
?>
once you are out of the loop that builds your breadcrumbs you can step back though it and echo the results.
again I have not tested this code, but it is the general idea on how I have done it in the past.
modified on Thursday, December 2, 2010 12:36 PM
|
|
|
|
|
Though you said that you don't have a site-map, does your site have a defined directory structure? For example, if you have a "news" module, are they in a directory like "/news/january/xxxx.php"? If that is the case, then you can use the request URI and explode it on the slashes. From there you can infer the breadcrumb depth. Of course, there are always exceptions, so I've used that in conjunction with a variable defined in an include file $breadcrumb, and then set that to be whatever breadcrumb I want. When it comes time to render it, I just check to see if that $breadcrumb variable is set. If it is not set, then use the directory structure, otherwise use the overridden value.
I'm sure there are many other ways, but this was quick and easy provided the directories make sense.
|
|
|
|
|
I have a HTML page which sends lots of field values(more than 100) to a PHP page to be INSERTed into Database.
Because of the huge number of fields, I decided to GET Variables and their values via Decoding URL. This works! But the problem is:
As it will be ECHOed, the Query is alright but the INSERT is not done!
It should be cited that I do manual INSERTing in this page, so there isn`t any problem with CONNECTION, DATABASE, TABLE and etc.!
plz help me! It is walking on my nerves!
Here is my PHP code:
__________________________________________________________
__________________________________________________________
Connection.php:
|
|
|
|
|
Two cents of advice:
1.
please show code in PRE tags, it improves readability, hence it will yield more or better replies.
2.
include error handling in all your code. (almost?) every MySQL function returns a result code, and when it is not OK you should call a function to get detailed reasons, as in:
$Results=mysql_query($query);
if (!$Results) die("DB Error in WriteQuery ($query)".mysql_error());
|
|
|
|
|
my best debug for get, post and/or session...
echo "<pre>";
print_r($_GET);
print_r($_POST);
print_r($_SESSION);
echo "</pre>";
place this near the top of you page and then run the page. you will get to see what is being sent/stored for the page and can then debug your code from there.
All the Best,
Chris J.
|
|
|
|
|
I am trying to submit a form on my page. It's proving to be a very difficult and frustrating task.
The problem is that there is no way of telling how many 'fields' will need to be submitted. The user might add 50 products to the cart, and make 30 changes to the quantities, or they might add 600 products to the cart and make 599 changes to the quantities (you never know), and with this website, the client is expecting high volume of sales so I need to be prepared for cases such as that.
I have a Table (a script that I bought) which has its own form tag for the data inside the table, however it uses GET not POST. And I am using:
foreach($_GET['items'] as $p=>$q)
{
}
But I dont know how to do this. I have tried hundreds of variations of the above snip and NOTHING has worked for me.
I have searched all ovver php.net, google and am out of ideas, and would greatly appreciate anyone's advice or help.
How can I update ALL form fields to the database?
Thanks
Edit:
The result of
print_r($_GET); is:
Array ( [ct_items_per_page] => 10 [ct_sort] => t_t_t_t [ct_page] => 1 [ct_search] => [ct_items_per_page_change] => all [ct_multiple_search] => Array ( [0] => [1] => [2] => [3] => ) [product] => M5 x 1 MTR Allthread (Grade 304 Unit Price) [items] => Array ( [1] => 45 ) )
Edit:
What else would work in my situation? Does anyone have any links/tutorials/articles? I cannot find anything anywhere. Are there other ways to submit all fields to a database?
modified on Monday, March 28, 2011 1:18 AM
|
|
|
|
|
can you post your form code?
|
|
|
|
|
my criteria is an user will paste the URL (an web page which got video) (eg: http://www.youtube.com/watch?v=hTgnDLWeeaM&feature=topvideos[^]) to a textbox and click on submit button, it will redirect to the other page to show the movie.
Normally when i want to embedd a video to my own webpage, i will just copy the embedded code and just paste it to my web page.
But I wonder, what are those steps to SEARCH and GET the embedded code by just submit an URL but not "embedded code" itself.
Or am I got an blind spot here, it is not necessary to get the embedded code in order to embed a video?
How am i going to embed video to my own page by an URL?
|
|
|
|
|
I wanted to implement payment gateway in which a user can accept all credit card and debiot card details for payment.
|
|
|
|
|
And you want us to wish you luck????
Ok here goes, good luck with it.
But seriously, what do you want to know. We need some information as to what you are getting stuck with. And keep in mind that you will have to partner up with a payment provider to be able to charge using credit card or debit card (like PayPal, GlobalCollect, Bibit, etc...)
Once you are approved by one of them I guess you can start implementing their API to process payments.
|
|
|
|
|
I want to convert php script to .exe have you any idea.Like simple script hello brother
<?php
echo "Hello Brother \r\n";
sleep(10);
?>
now convert it to exe
|
|
|
|
|
I think facebook has a php to exe coverter called Hip-Hop that is free to use. try a google search. I have read a few articles and it is supppose to have a large impact on the execution speed.
-- Chris J
|
|
|
|
|
I think you cant do this with php
you can use another language
|
|
|
|
|
|
|
Is there a way to send FILE post data through PHP code.
I found a code which send common POST data:
fputs($fp, "POST $path HTTP/1.1\r\n");
fputs($fp, "Host: $host\r\n");
fputs($fp, "Referer: $referer\r\n");
fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
fputs($fp, "Content-length: ". strlen($data) ."\r\n");
fputs($fp, "Connection: close\r\n\r\n");
fputs($fp, $data);
How do I send $_FILES data through POST. Is that posible?
|
|
|
|
|
they are referenced in a different variable...$_FILES.
But you need to have an input element of the type files in your post form first. So someething like
<form action='' method='post' enctype='application/x-www-form-urlencoded'>
Name: <input type='text' name='user'>
Img: <input type='file' name='pict'>
<input type='submit' name='action' value='Upload'>
</form>
You would access the form elements with...
$_POST['action'] for the submit button
$_POST['user'] for the user field
$_FILES['pict'] for the pict field. Keep in mind this is an array and has a number addition values. You can read more about that here http://www.php.net/manual/en/features.file-upload.php[^]
|
|
|
|
|
|
I've tried putting
header('Location: http://www.google.com/');
at the end of one of my scripts, but it won't redirect. If It's just
< ?php
header('Location: http://www.google.com/');
?>
it works fine. I need to be able to run some stuff before it redirects the page.
|
|
|
|