I need to add the URL 'user/7/orders' to a particular menu. As this requires PHP for the UID (7), how do I write a script to add an item to a particular menu?
I want to Zend_Auth and Zend_Session to save user sessions and logins information
whats the easy and best way for implements following items:
1-Disallow multiple concurrent logins for the specific user
2-List all of all user currently logged in
3-Admin could logout of specific user or destroy specific session
Is there any special ZF or PHP API or library that can do the above?
thanks
How can I use PHP to strip out all characters that are NOT alpha, numeric, space, or puncutation?
I've tried the following, but it strip punctuation.
preg_replace("/[^a-zA-Z0-9\s]/", "", $str);
I need to write php code to identify common e-mail errors, like "inbox full" or specially "invalid email name" from email messages, because we need to clear our databases from nonexistent emails.
I'm looking the MIME and IMF formats but I didn't find any kind of standard error code, does it exist?
it's can be apply not only to wordpress. But to all blog platform that can be installed into a server and shared host. so, What do you do via PHP coding or pluggin or any method to secure your installation ?
I guess these are all questions that everyone must just know, because I'm not seeing this in the documentation :-D
I understand that the public folder is the folder that the world has access to.
I know it is the case with the css folder, but in migrating a traditional php website over, will my /images folder, /js folder /mp3s, etc Will those all just also be public folders that will be accessed via the layout or view.phtml pages?
Thanks!
I am trying to create folder like this
$destination = "../enumesis.com/_pcode/../_compile";
mkdir($destination);
But this gives error
UPDATE
What i am doing is, taking ../enumesis.com/_pcode as input from user and I want to create a folder outside the _pcode Directory
Here is my error
Warning: mkdir() [function.mkdir]: No such file or directory in G:\wamp\www\tools\compile.php on line 57
../enumesis.com/_pcode/../_compile
Hello,
In the code below, I would like to make the word that prints out as the variable "$submittor" a hyperlink to "http://www...com/.../members/index.php?profile=$submittor" .
I can't get it to work; I think I'm doing the formatting wrong.
How can I do it?
Thanks in advance,
John
echo '<div class="sitename3name">Submitted by '.$submittor.' on '.$dt->format('F j, Y &\nb\sp &\nb\sp g:i a').'</div>';
I want to make an email for my website like "[email protected]" where people can send their feedbacks and suggestions to it. How can I do it? Can I do it with PHP or there is something else needed?
In php we use includes. So variables defined in one file and then their scope spans included files too.
Zend studio has no idea how to get the type of the variable I am using inside an included file, this is very annoying when the variable type is a big class.
Is there a way to hint the ide about variable types? in included files?
Hai frnds i am new to php i am having following problems in my coding...
1.Actually i am opening word document with com object and storing it in textarea.
2.when content gets opened in textarea i am editing that content and saving the document
3.actually when i edited that file and done save after that if i open word document then file properties-custom the old content getting removed i wannt to retain that even if i edited the word document..please do the needful
i am using below code
<?php
$filename = 'C:/xampp/htdocs/mts/sites/default/files/a.doc';
//echo $filename;
if(isset($_REQUEST['Save'])){
$somecontent = stripslashes($_POST['somecontent']);
// Let's make sure the file exists and is writable first.
if (is_writable($filename)) {
// In our example we're opening $filename in append mode.
// The file pointer is at the bottom of the file hence
// that's where $somecontent will go when we fwrite() it.
if (!$handle = fopen($filename, 'w')) {
echo "Cannot open file ($filename)";
exit;
}
// Write $somecontent to our opened fi<form action="" method="get"></form>le.
if (fwrite($handle, $somecontent) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
echo "Success, wrote ($somecontent) to file ($filename) <a href=".$_SERVER['PHP_SELF']."> - Continue - ";
fclose($handle);
} else {
echo "The file $filename is not writable";
}
}
else{
// get contents of a file into a string
$handle = fopen($filename, "r");
$somecontent = fread($handle, filesize($filename));
$word = new COM("word.application") or die ("Could not initialise MS Word object.");
$word->Documents->Open(realpath("$filename"));
// Extract content.
$somecontent = (string) $word->ActiveDocument->Content;
//echo $somecontent;
$word->ActiveDocument->Close(false);
$word->Quit();
$word = null;
unset($word);
fclose($handle);
}
?>
<h6>Edit file --------><? $filenam=explode("/",$filename);$filename=$filename[7]; echo $filename ;?></h6>
<form name="form1" method="post" action="">
<p>
<textarea name="somecontent" cols="100" rows="20"><? echo $somecontent ;?></textarea>
</p>
<div style='padding-left:250px;'><input type="submit" name="Save" value="Save"></div>
</p>
</form>
<?
}
?>
it needs facebook facepile plugin(http://developers.facebook.com/docs/reference/plugins/facepile).
i tried but i am getting this error
(The Facebook Connect cross-domain receiver URL (http://static.ak.fbcdn.net/connect/xd_proxy.php#?=&cb=f223d517566e616&origin=http%3A%2F%2Fpromolife.com.au%2Ff3e13728ba8ec8&relation=parent.parent&transport=postmessage) must have the application's Connect URL (http://www.testsite.com.au/) as a prefix. You can configure the Connect URL in the Application Settings Editor.)
why do i getting this error please help me.
Good afternoon,
I will first start with the goal I am trying to accomplish and then give a very basic sample of what I need to do.
Goal
Instead of collecting several variables and naming them with keys individually, I have decided to give in and use an array structure to handle all inputs of the same type and rules. Once I have the variables, I will validate against them and if 'ok' store them in a MySQL table. The table will hold consumer information and will need to store multiple rows of the same type of information.
First Pass
I will leave out the validation portion of this question because I feel I need to first understand the basics.
<form action="?" method="POST" name="Form">
Member 1 First Name:<input type="text" name="MemberFirstName[]" /><br />
Member 1 Last Name: <input type="text" name="MemberLastName[]" /><br />
Member 1 Email: <input type="text" name="MemberEmail[]" /><br />
Member 2 First Name:<input type="text" name="MemberFirstName[]" /><br />
Member 2 Last Name: <input type="text" name="MemberLastName[]" /><br />
Member 2 Email: <input type="text" name="MemberEmail[]" /><br />
Member 3 First Name:<input type="text" name="MemberFirstName[]" /><br />
Member 3 Last Name: <input type="text" name="MemberLastName[]" /><br />
Member 3 Email: <input type="text" name="MemberEmail[]" /><br />
<input type="submit" name="submit" value="Continue" />
</form>
I am hoping that each input given for First Name (a required field) will generate a unique key for that particular entry and not overwrite any data entered. Because I am carrying information from page to page (checkout form), I am turning the POST variables into SESSION variables then storing in a mysql database in the end. My hope is to have:
<?php
$conn = mysql_connect("localhost", "username", "password");
mysql_select_db("DBname",$conn);
$sql = "INSERT INTO tablename VALUES ('$_SESSION[Member1FirstName]', '$_SESSION[Member1LastName]', '$_SESSION[Member1Email]', '$_SESSION[Member2FirstName]', '$_SESSION[Member2LastName]', '$_SESSION[Member2Email]', '$_SESSION[Member1FirstName]', '$_SESSION[Member3LastName]', '$_SESSION[Member3Email]')";
$result = mysql_query($sql, $conn) or die(mysql_error());
Header ("Location: completed.php");
?>
Where Member1, Member2, and Member3 values will appear on their own row within the table. I KNOW my code is wrong but I am giving a first shot at the overall business purpose I am trying to achieve and trying to learn how to code the right way.
I am very, very new to programming so any 'baby advice' is greatly appreciated.
I really would like to integrate the Myspace ID platform on my site using PHP, instead of allowing users to sign in to my site anytime with there myspace ID I am planning on just using it 1 time on signup process to allow them to import profile data from there myspace to my network.
I have note been able to find any good example code for doing any kind of myspace integration, has anyone done this and care to share any info on the issue please?
A non-hypothetical but abstracted situation:
I have a domain www.foo.com, from which I'm making an AJAX POST to beta.foo.com. Examining the XHR object, I see a response header of 200 OK, but no response text - I even get a response 12B long, which is the exact response (a 12-character string) that I'm expecting - but the response text is blank.
If this is a cross-domain issue, why am I getting 200 OK, and better yet - why am I seeing the PHP functions fire on the beta.foo.com side - yet getting no response?
I am creating an framework in PHP, and i am using and MVC structure. My link look something like this: mydomain.com/controller/action
So this link loads a controller, which loads the needed action. Now my page needs a header, footer, and it has a menu which is in the database. Where do i load all these things.
Is this the job of the controller, or the job of the model.
Hi out there,
i'm trying to get the latest podcast informations out of "itunes store" to work with this data in several applications (iphone app and web app).
Is there a way to get this informations? RSS, JSON or something?
i want to work with this informations in objective-c and on a website with php or js.
Is my question clear? :(
I have a WordPress installation on my site, and I want to display WP posts on other parts of my site (that is outside the WP installation). How do I do that with PHP?
I tried to search this type of question on Stack Overflow, Google and WP official site but I didn't find anything.
Hi guys,
I have build a php authentication for my site http://www.skyeye.cc/ and wanted to make sure I didn't forget any security holes... let see if you can hack into it?
Thanks!
I have an array in PHP with URLs like below:
http://example.com/apps/1235554/
http://example.com/apps/apple/
http://example.com/apps/126734
http://example.com/images/a.jpg
http://example.com/images/b.jpg
http://example.com/apps/2331234/
http://example.com/apps/orange/
How can I separate out these urls and push them to another array using Regex:
http://example.com/apps/1235554/
http://example.com/apps/126734
http://example.com/apps/2331234/
Only url with apps/{number}/ and apps/{number} should be selected.
In my application, I ask the user to enter their cell and select their provider. I append the provider's email and create the message and fire via php.mail()
The problem is that no matter what the header info is, the message comes from '1010100001' on some phones (like AT&T and the iPhone). When testing on my Verizon phone, I get the proper email address as the sender.
Any idea how I can send a clearer message?
I have an array that I am constructing in PHP which I am serializing then returning to Flex through AMFPHP. Can someone point me towards a solution for unserilizing said data once it gets into Flex via ActionScript 3?
I have a form which has a field for email id. When form is submitted then a confirmation message should be send automatically to the given email id, how?
I want to do this in php.
Example link on my footer
$powered = 'Powered by <a href="htp://stackoverflow.com">Stackoverflow</a>';
theme file
<?php echo $powered; ?>
How to make if $powered removed from my footer and the error/reminder notice it.
Example die('Do not remove the powered link')