We use custom bbcode in our news posts
[newsImage]imageName.jpg[/newsImage]
And i'd like to use preg_match to get the imageName.jpg from between those tags. The whole post is stored in a variable called $newsPost.
I'm new to regex and I just can't figure out the right expression to use in preg_match to get what I want.
Any help is ap...
Trying to simply get an image returned. But the following returns an error 'An error occured.' Is it possible I need to configure php on my server differently?
if ( isset ( $GLOBALS["HTTP_RAW_POST_DATA"] )) {
// get bytearray
$im = $GLOBALS["HTTP_RAW_POST_DATA"];
// add headers for download dialog-box
header('Content-Type: image/j...
Hey guys,
I'm really just looking for some guidance. Here is the scenario:
A user can add an FTP account via a password protected control panel. I need to save these credentials so that the FTP account can be connected to automatically. This is easy but I want to take the most secure approach possible. I was thinking of possibly encryp...
ZF has a very nice feature which is called findManyToManyRowset which returns you directly a collection of objects from a MN connection. The whole purpose of MN is to get the information from the other table, not from the connection table.
We have this schema:
- users
- id
- name
- groups
- id
- name
- user_has_groups
- use...
I have a simple form accomplished with Zend_Form which is retrieving all its parameters from an XML file. Form has a file input which I need to allow empty submits as well. I mean users should have the chance to leave this field empty.
I tried various combinations of allowEmpty and required directives but no help. Below is the XML block...
Hello
I am using the following to generate a form:
<form method="post" action="">
<input type="hidden" name="group_name" value="<?php echo $user_group ?>" />
<table width="100%" border="0">
<tr>
<td>User</td>
<td>Email</td>
<td> </td>
</tr>
<?php foreach ($user_info as $key => $array) {
while ($row = mysql_fet...
I wrote a JavaScript script that swaps two selected img tag src values.
The point is to let the user rearrange a list of images.
For sending the new order to a PHP script, I have two ideas:
Have a button execute a JavaScript function that gathers the new order of images into an array of URLs. Then, rely on JavaScript to send the data...
We are using sendmail to send mails from our web app and we do not need to receive emails. Only our machine should be able to send emails from the sendmail server.
What's the best way to make sure sendmail is running secure on our server.
Again, we only need to be able to send mails using php's mail() function, nothing more.
...
Ok, I'm not 100% sure what I'm doing wrong here. Maybe I just need a second pair of eyes to reveal the error of my ways. I'm sending a JSONP request using jQuery from one domain (https://customerhub.net) to a PHP script on my domain (https://dankennedy.com) and getting a response from that script. I know the request is working because...
Hi,
I need to reprocess some files using attachment_fu, but not all of the files.
I've seen a few posts asked about reading and listing files in a directory using Ruby, but does anyone know how to select the files based on the upload date or file parameters?
I can use either the date parameters for when the file was uploaded or loo...
To preface: this has got to be one of the strangest bugs I have ever seen, especially since it comes and goes.
There exists a page called view.php and another page called save.php. The bug manifests when I request save.php - I instead get view.php. Request headers say save.php, and it happens in Firefox, IE, Chrome, Opera, Safari. It ha...
Is there a way to lock a Mysql table only for write, so that another script can still make a SELECT query?
I'm using this code to write to a table (executes almost every second):
mysql_query("LOCK TABLES table WRITE;");
mysql_query("insert into...
mysql_query("UNLOCK TABLES;");
and this to select (this script just freezes, probably b...
How do I use the DOM parser to extract the content of a html element in a variable.
More exactly:
I have a form where user inputs html in a text area. I want to extract the content of the first paragraph.
I know there are many tutorials on this, but could not find any on extracting from variable and not a file(page)
Thanks
...
Hi I have a bit of PHP experience and I am tasked with making an automated script to post to twitter account. We have a RSS feed which is updated when we make a new article entry into the site, and would like to pass this info to the twitter script.
I am speaking about the process of taking the latest RSS feed and moving it to the twitt...
I need to secure a folder. Website was done in PHP. There is an admin area with files like PDF, DOC… so; I cannot protect these files with session variable. Is there a way in PHP to protect a folder?
Thank you
...
I did the same upload form for photo uploading like here. Is it everything I can do to protect my website or I need to add something? Thank you very much.
...
I am sure this is the one of the most epic titles ever. So, I have upload form like here. I made that people could upload their files only up to 1 MB. But, if I try to upload for example 1 GB file, it takes ages before it gives me an error. So, here comes a question. Before checking file's size, does that file is being downloaded in my h...
I've got flex 4 and am trying to connect to a php dataservice. I've got paging enabled and have tweaked the default paging method so I can filter the results, ala "SELECT name, form FROM $this->tablename WHERE id='$q' LIMIT ?, ?". When I test the call via the built-in test function in Flex I get the results I want when I put in a filter ...
I'm trying to grab/fetch text from another URL using cURL. The location of where I grab the text from is within a blank HTML document with dynamic (not static) data, therefore there are no HTML tags to filter. This is what I've got so far:
$c = curl_init('http://url.com/dataid='.$_POST['username']);
curl_setopt(CURLOPT_RETURNTRANSFER, t...
hi ..
This is my chats' sign out function. It works perfectly when I open the chat on a page alone.e.g. www.abc.com/chatbox/index.htm
But when its with other elements in the same page using iFrame it will not work.e.g.www.abc.com/chat&paintIframe.htm
This is my code
<script type="text/javascript">
function singout(){
data="user=" + ""...