Thankx much for all ur contibutions,what i get here is like
i`m now supposed to Learn JAVASCRIPT.
Yes, you're dealing with the web, you have to learn Javascript.
Thankx much for all ur contibutions,what i get here is like
i`m now supposed to Learn JAVASCRIPT.
Yes, you're dealing with the web, you have to learn Javascript.
Give me a real-world example of what you want because you're sort of all over the place on how you want the query to work. You really only have a few options
-- LIKE matches some_inner_string_here
WHERE string LIKE '%inner_string%'
-- LIKE matches whole_string
WHERE string LIKE 'whole_string'
-- WHERE IN matches a group of things
WHERE character IN ('A', 'B', 'C', 'D')
Please for the love of all that is good don't use Jodin's example.
echo json_encode($your_php_array);
Done.
You might be able to do
WHERE user_role IN ('A', 'S', 'D')
Place an empty span next to the inputs and then instead of alert("Your blah met our requirements."); do something like
<input id="passField" name="passField" type="text" /><span></span>
var checkdiv = document.getElementById('passField').nextSibling;
checkdiv.innerHTML = "<img src='somecheckpassimage.jpg' alt='OK' title='OK' />";
He means the lightbox that pops up. Search for either thickbox or lightbox, (This is a Javascript issue so take further posts over to that forum)
parse anything, including variables?
In other words wont accept or compute variables or resource names?
// HereDoc
$somevar = "Hello";
$somestring = <<<END
$somevar World!;
END;
echo $somestring;
// Hello World!
// NowDoc
$somevar = "Hello";
$somestring = <<<'END'
$somevar World!;
END;
echo $somestring;
// $somevar World!
but you would be able to make the server not process other data or not load certain things at certain times on the server not the end user pc which i think this is what thread is about but i could be way off
Yeah, you could make YOUR server not process their data but what this guy wants is not possible in PHP or any other language that has to do with the web (Save languages that transfer over like Java)
You can't block the user from doing anything in PHP or Javascript. You have to use a platform language like C/C++/Java/etc. I will repeat myself, you will NEVER, EVER be able to control a user's machine from the browser whether that be Javascript, or PHP, or ASP, or anything else.
Im not sure but I think you cant send mail from a home made server like apache, etc.
I guess if you wanted to you might have to hand out some cash and make your localhost a full fledge server, which you may or may not be inclined on doing.
All you need is to set up an SMTP server. Most linux distros come with 'sendmail' installed which is probably the most popular. I have no idea how to do it in Windows.
this.options[ this.selectedIndex ].value
is exactly the same as
this.value
when applied to a select box.
In getstates.php, your do{}while(); should be just while(){}. And remove the mysql_fetch_assoc after your mysql_query call.
<input name='<?PHP echo $currentrow;?>_Zip'." type='text' value='' size='10' maxlength='10' />
Remove the ." after _Zip', so
<input name='<?PHP echo $currentrow;?>_Zip' type='text' value='' size='10' maxlength='10' />
There's a lot of other stuff. for instance, why did you write your own AJAX connection library instead of using jQuery or Prototype or something else?
for anyone interested, it's the functions imagesx and imagesy that give you the width and height of a resource image.
http://php.net/GD The PHP documentation should be your first stop when you have a question like this.
Thanks djjjozsi I seem to be getting somewhere !:)
I have the site back up but at the top of the page it says//
Warning: Wrong parameter count for explode() in /home/flyagdei/public_html/templates/lingerie_4/main_page.tpl.php on line 15which is this bit $time = explode( $time);
Any more ideas?
Thanks again guys
Jo
Yeah, here's an idea, go read the documentation for explode
. php.net/explode
You can't have multiple -- in an HTML comment aside from the --> at the end, it's invalid. Secondly, you forgot the > on the beginning body tag.
<body>
<!--body positioning-->
<div id="bodypos">
<!-- header-->
<div id="header">
<div id="logoposition"></div>
<div id="banposition"></div>
<div id="headpub"></div>
<div id="menu"></div>
</div>
<!--header ends here-->
<!--body content-->
<div id="contbd">
<!--left column-->
<div id="leftcol"></div>
<!--left column ends here-->
<!--center and right column-->
<div id="rightngb">
<div id="centcont">
<div id="headnews">Amakuru yo mu Rwanda no hanze</div>
</div>
<div id="rgtcol"></div>
</div>
<!--center and right column end here-->
<!--footer-->
<div id="footer"></div>
</div>
<!--body content ends here-->
</div>
<!--body positioning ends here-->
</body>
According to the documentation, such may be the case if PHP is in safe mode, is this true?
It has nothing to do with safe mode, he's killing the script before it can echo because of return $response;
It doesn't always have to be EOT, it can be any string as long as the end is the same. Heredoc is used over quotes strings because you don't have to worry about escaping anything save $. In 5.3 PHP is getting nowdoc which is heredoc but wont parse anything, including variables.
The { at the end, before the ?> should be }.
@Josh, PHP 6 doesn't exist yet and wont for a long while :)
For lonestar. getElementsByTagName returns a DOMNodeList which, when iterated over, each entry is a DOMNode which can act as a DOMElement which has the function getAttribute($attr_name); So you can do (in theory, see php.net/DOM):
$elemlist = $someDom->getElementsByTagName('link');
foreach($elemlist as $elem) {
var_dump($elem);
}
}
Browsers do that by default. They will submit the form you're currently on when you hit enter(unless you're in a textbox) you don't have to do anything special.
Hi.
Sure, I can give you an example.
It's pretty basic at this point, but I assume you are going to be adding your own methods to it.Note that I don't store the actual password used for the connection, but rather a SHA1 has of it. (For security reasons)
And I don't allow the outside code to alter the stored database connection information. (No reason to allow that, really)Also note that I use the constructor to connect to the database.
If you want the class to support reusing an instance for multiple connections, you will need to createopen()
andclose()
methods.<?php class MySQL_Database { /** The database link,. * Used by the code to execute queries and such **/ private $dbLink; /** Connection property values **/ private $host; // Host name. E.g. "localhost" private $user; // Name of the MySQL user private $dbName; // Name of the database to use private $password; // A hash of the user's password /** * The constructor. * Establishes a connection to the database. * @param string $host * @param string $user * @param string $password * @param string $dbName */ public function __construct($host, $user, $password, $dbName) { // Connect $this->dbLink = mysql_connect($host, $user, $password); if(!$this->dbLink) { throw new Exception("Connection to database failed."); } if(!mysql_select_db($dbName)) { throw new Exception("Failed to set the database."); } // Set getter values. $this->host = $host; $this->user = $user; $this->dbName = $dbName; // Create a hash of the password and store it. // …
Try loading the module at runtime using dl(). It should provide you with a warning about why the module couldn't be loaded
No, please avoid them like the plague. They're annoying, old, and rickety just like websites that use them. The only function they serve now are for hacks for file upload.
I do not understand why we (the programmers) use unnecessary huge buggy codes of our own for resizing images??!! As we've phpThumb, custom image resizing functions are just a history. Then why do we manually write those codes again and make our script buggy!
Yes I know what I am saying. I was using my own codes for image resizing and one day I got problem with corrupted images and got no solution. Then I used phpThumb and the problem is fixed..
To know more details please visit this
Because that's how programmers work. phpThumb didn't magically appear, there was some dumb guy/gal saying "Well I don't like that library, I'm going to write my own and name it phpThumb." It just so happens other people started using it. So, of course, there are still programmers that say "Well, I don't like that library I'm going to write my own."
Most of the time it's because in programmers' heads their code rocks and everyone else's sucks.
Use one or the other, not both. PHP was originally used as a replacement for SSI bull. Bottom line is, don't use SSIs
Hmmm, just something to say, I have never seen anyone user the round brackets to take post data...
you were usering $_POST('egnejg');
it should be $_POST;And you can't use EDO twice I think you must use a different three letters for instance FOD...
Yeah $_POST('something') would throw an error saying that a Function name must be a string, so switch to []. As for the HEREDOC, you can use the same delimiter as many times as you wish.
Well if the data is web-based and presented with no download option then fetching the data from the page is called screen scraping. If it does provide a download option its just called downloading :)
You should note that none of those stylesheets will work, nor will the links or anything else in the email that references a file. They all must be ABSOLUTE paths, including the domain.
Also, if you're getting a white screen make sure you have error reporting turned on: error_reporting(E_ALL);
at the top.
There are a few things that dont look right but :
- What is all of this EOD stuff? Never seen it before in my life?
- Check your names of the $_POST fields as they contain bad naming conventions
- Last line should be "echo $theResults;" no quotesSee that gets anything on the page?
The EOD stuff is called HEREDOC, php.net/HEREDOC
miley cyrus lol
haha,
how do i write a program?--I have no idea how i write a program, go away!
how old are you?--I just don't know, OK. Maybe I'm not so great, go away while I cry.
why do you suck?--For one, that's not a very nice thing to say. Secondly, you are insulting a computer.
i don\'t like you.--That's not even a question, how dare you waste the great Oracle's time!
why are you gay?--Because I said so, alright? Is that a good enough answer?!
why are you a flaming homo?--Because I said so, alright? Is that a good enough answer?!
who is the president of the united states?--Hell if I know who the president of the united states is!
123*321--That's not even a question, how dare you waste the great Oracle's time!
why don\'t you know basic things?--Because I said so, alright? Is that a good enough answer?!
who was the first man on the moon?--What, just because the Oracle I know everything? .... Oh
where is waldo?--Luoiston, Kentucky along with Carmen Sandiego
I put in a bunch of edge cases that nobody ever uses like "Where in the world is carmen sandiego?" and "How much would could a wood chuck chuck, if a wood chuck could chuck wood?"
It seems to be a max execution time error. I got some other error messages as well for the image resizing but I always get these but they resize anyhow.
Just changed the max execution and input times to zero for now as that will give it unlimited and will allow me to find out if this is indeed the issue.
If it were a maximum execution time issue you would get "Maximum execution time of X exceeded by FILE. This is indeed a puzzling question.
>When were you born?--I'm an Oracle not a time traveler!
That would have been me.
I could take an educated guess that "How is babby form?" is iamthwee but I may be wrong :)
HAHA, questions that people posed to my oracle:
what is 2+2?--A little math, eh? Well, 2+2 = 4
what is 2*2?--A little math, eh? Well, 2*2 = 4
what is 2*123423?--A little math, eh? Well, 2*123423 = 246846
what is 123312342*123423?--A little math, eh? Well, 123312342*123423 = 15219579186666
What is your name?--I'm a damn computer! Get outside!
Who are you?--I am your king!
Who am I?--Like, who is anybody man?
Hello--That's not even a question, how dare you waste the great Oracle's time!
What time is it?--It is currently Wed, 03 Jun 2009 16:41:18 -0400
Ohh come on.--Really? You're not following directions.
Are you real?--I don't have all day. This is getting annoying.
What is your name?--I'm a damn computer! Get outside!
How old are you?--I just don't know, OK. Maybe I'm not so great, go away while I cry.
Why are you here?--Because I said so, alright? Is that a good enough answer?!
Who are you?--I am your king!
Who am I?--Like, who is anybody man?
When were you born?--I'm an Oracle not a time traveler!
who am i--Like, who is anybody man?
will i fuck--That's not even a question, how dare you waste the great Oracle's time!
What is boil--Shit if I know.
What time is it?--It is currently Wed, 03 Jun 2009 19:11:23 -0400
How is babby form?--I just don't know, OK. Maybe I'm not so …
The code that I posted worked against the file you gave so there's something wonky you're doing with the adtext variable in between there. As a start, get rid of all those damn str_replaces for newlines, you don't need them you're inserting into a CDATA field. I'm not about to decode what the heck those other str_replaces/strpos's are doing, I'll leave that to you
If it were a memory issue you'd get Allowed memory size of X blah blah, trying to allot X bites on line X. Make sure you have error_reporting turned on.
Well PHP can't play video, the user would never be able to see it :) Perhaps you should try the Javascript or Graphics and Multimedia forums
This should be in the PHP forum, but at the same time it should not be. Read the FAQ in the PHP forum before you post again.
Yep make another file called page.php then use JavaScript and AJAX to retrieve it once your document is ready.
In this page.php you use file_get_contents() to retrieve the files contents.
Note that you cannot use AJAX to fetch content from a domain other than the one the script runs on. The browser will not let you execute cross-domain AJAX requests.
A) use php -l <scriptname> to run PHP Lint to check for syntax errors
B) If you haven't already, remove the damn @ (error suppression)
C) Check your memory limit
D) If all else fails load the page, edit the script to die at one step, then upload and see if it still white-screens, repeat steps until it DOES whitescreen.
Also, remove all of the @#$% error suppression, it's slow and makes it hard as hell to debug.
Do you get an error or does it just white-screen?
Oh, that's just for a makeshift title, we display the first 50 characters or whatever. A couple lines down you'll see $adtext and that's where the whole thing gets displayed (or would if I could get it to work properly).
yeah, I noticed that 3 seconds after I posted it, hence the edit :)
So... the content you gave me is obviously nothing like the content you're using because there were no HTML tags in the example file you gave. Don't put a newline after every attribute, its wasted space, only put a newline after the tag if even then. And paste your output.
I just tested it again and it definitely works. What exactly is your code?
What the code does is reads in the file into an array with each index being a line. What the loop does is goes through each line and checks to see if it starts with your first key which is a series of numbers followed by |. So 3335| or 67341|. If it doesn't match this pattern then it is assumed that it is part of the last row so it is appended to the last row and it continues from there.
This is a bit of a tricky one but you could do something along these lines:
$somefile = file('blah');
$rows = array();
$row_counter = 0;
foreach($somefile as $line => $content) {
if(!preg_match('/^[0-9]+?\|/', $content)) {
$rows[$row_counter] .= $content;
} else {
$rows[++$row_counter] = $content;
}
}
$rows
should contain your corrected array