![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
RussellReal
-
Posts
1,773 -
Joined
-
Last visited
Posts posted by RussellReal
-
-
you're not finding it because first comes before second, and "sec" doesn't exist in "first" and either way if it matches or doesn't match, you die() the script.. take the die() out of the else statement and you should be okay..
<?php
$array=array('first','second','third','3423a','3423');
foreach($array as $arrays){
$result=strpos($arrays,'sec');
if($result!==false){
echo 'found it<br />';
die;
} else {
echo 'NOT found it<br />';
}
}
?>
-
well..
it is possible on windows I think, to open a com connection with internet explorer.. navigate the browser to the location, and then grab the screenshot which then would return an image resource then you save the picture to your website and PRESTO
(going off of what I just found on php.net I run linux on my webhosts >.>)
-
no, your post is very detailed, *thumbs up*.
unlink deletes files, when you click on whatever options you have in your interface, run unlink on the file and it should trash the file from the server..
date created idk about..
if you mean date created on the uploader's end.. idk if you could..
but! You could record the date UPLOADED with date
-
I agree with maq lol
-
header("content-type: image/jpeg");
-
just as a side note..
// Select DB
$db_select = mysql_select_db("hightrek", $connection);
you don't need
$db_select =
you could just do
// Select DB
mysql_select_db("hightrek", $connection);
-
you forgot regex delimiters
} elseif (!preg_match('/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z][A-Z.]{2,4}$/i',$_POST['email1'])) {
-
you want a desktop application to connect to your php mysql panel type thingy..
if it is ALREADY configured in your php.. and it completely works with your php
then all you need to do is show what the php shows..
so make your vb app or whatever, connect directly to your php (with a web browser ofcourse) and then you have a desktop app.. in like 2 minutesa
-
chronister you came on here acting so nice
you make me feel bad lol! but yeah, mysql really does help handling data ALOT, and its so much faster to let mysql do all the cataloging and greabbing and parsing, all you do is REQUEST the data, and then handle it.. its like effortless, rather than with a text file create a system which allows you to edit, remove, add, grab, parse, from a plain text file, and still hold its place within the file.. save the effort and just get hooked on mySQL
practically all my applications I code, use mysql now, unless its a parser or sumfin simplistic like that.
-
idk if that works I used to mostly do just a foreach loop.. but this looks like it should work =\
<?php $array = array("0" => "a","1" => "b", 3 => "d"); $arrKey = range(0,count($array) - 1); $array = array_combine($arrKey,$array); ?>
-
try that, and I just gave a lecture about giving out scripts :'( I'm a hypocrite
but this was fun
<?php $array = array(1,3,4,7,8,12,13,14); foreach ($array as $k => $v) { if (isset($prev)) { if (($v - $prev) != 1) $newArray[] = $v; } else { $newArray[] = $v; } $prev = $v; } print_r($newArray); ?>
-
what about recurring? like 1 1 1 1
and should this be alpha numeric or just numeric?
-
I seem to notice in the bottom example yoru script favors 16 over 15 and 44 over 45 is there any specific meaning for this?
-
probably will be your only constructive post here..
This isn't for script requests, although you may see us write scripts for people, we write scripts to correct already written code or to help correct a problem with already written code.
I'm not trying to come off like a prick, but most of us spend alot of time on this forum and like helping people, and thats what we intend to do, HELP, but give out.
I know this is a help request though but many people will most likely disregard this after you have "someone write the basic code for me" in the thread..
unless maybe I'm speaking for myself ofcourse, however, unlikely.
I can however point you in the right direction, then when you have some established code we can try to help you with errors you encounter.
I recommend you use mysql (#1), you can get the date using date, although for databases you should use the timestamp, that way you can code with it (all languages are more mathematical than anything else).
to check for past events, you would use an if statement and compare time with the timestamp in the database, "if timestamp less than time THEN its older OTHERWISE (else) its new"
this is actually pretty simple..
hope I help you bro and sorry for sounding snobbish
-
any extra un needed cpu time is worthless..
if you took a string that was 300k charslong.. which is possible.. and applied the following function 10 times to the string..
function abc($string) {
return strlen($string);
}
then applied the above function 10 times to a string like "hello" you can assume that it would run slower on the first one than the second one.
now, thats because its more data for php to handle, having many resources you'd assume works the same way..
resources are exactly that, resources. You take a 10 mysql connections, the amount of memory to keep reference to the 10 mysql connections is much more than you'd expect php to need, even idle its like adding white feathers to a box of offwhite feathers and trying to seperate em in order to count em.
its going to take a while, but if its just 1 offwhite feather and 1 white feather, its much quicker to do this operation.
maybe I exagurated with 10x but any performance loss is performance loss..
that is why they created mysql_close() to free the allocated memory of that resource, before termination of PHP, to keep your scripts running efficiently.
is all I was tryna explain
-
$_SERVER['HTTP_REFERER']
-
AJAX
establish an xmlHttp object
connect to a php file which will spit out data according to what was sent to the page VIA GET
then, parse the return data, or just echo into javascript
and eval() the return javascript
-
SELECT * FROM `table1`
JOIN `table2`
ON (table1.user_id = table2.user_id)
WHERE table1.field = 'WHATEVER'
AND table2.field = 'WHATEVER'
-
just make a web browser.. and inside the web browser, navigate to some php and build the front end in php
-
do this
<?php
phpinfo();
?>
if it works php works..
if not you have to set apache up tow ork with php, not just have it installed..
-
shorttags are awesome though
do what daniel said, and when in doubt do what dennis said, but I really like shorttags so I dun vote against em
-
directed @ the people above talking about mysql connections
they are right as when PHP exits, all resources, (sql result resources, sql connection resources, socket connections, etc) are all destroyed
you need not close mysql connections unless you are going to use more than 1 connection, and you want to cut down on the weight you're putting on your server.. if you have 10 connections open you can assume that the script will run 10 times slower, but since scripts process so quickly it might go from like 1ms to 10ms and you'd hardly notice the difference..
but take that 10ms and multiply it by the amount of users on your website and that = heavy on your server.
although I'm not exactly sure if my timing is ACCURATE so accuracy ninjas please don't attack me for saying 10ms when its really 5.89273 ms for 10 connections lol..
so if you're terminating a mysql connection then trying to use it later, its obvious there is going to be an errror..
-
anytime
and mine shoulda worked
lol
-
question 1: did you name every field in your form results[] otherwise your $line variable is probably just 1 lkine long from 1 result (results) and thats why its sending the same data..
link me to the page and I'll try and assist you
Creating Query where two variables from two tables match
in PHP Coding Help
Posted
heyyy my name is Russell alsooo
waddup twindawg lol
try that =o