
l4nc3r
Members-
Posts
82 -
Joined
-
Last visited
Never
Everything posted by l4nc3r
-
You're putting func_get_args into an is_int function to check if it's an int. But it'll never be of type int because, like thorpe said, func_get_args returns an array.
-
Did you try require()'ing the ASP file?
-
For any general questions on functions, just use the manual. http://php.net/manual/en/function.date-format.php
-
One line I just am having a ton of problems with...
l4nc3r replied to cowboysdude's topic in PHP Coding Help
$link = '<a rel="lightbox[social]" title="DCC Videos" href="'. (str_replace("&feature=youtube_gdata","", $video['link'])).'">'; -
Is it possible to make a picture out of a div?
l4nc3r replied to jokerbla's topic in PHP Coding Help
I don't think there's any way to do that. Consider developing this app in Flash--seems more suited to your needs. -
Yeah, it is possible to hack with POST variables. Basically ANY information users submit to your site can be modified so as to hack. The way I prevent hacking with AJAX is I send a request to put some data in a database. If the data does not check out (after processing with a PHP script), I send back an <errormessage> node with a relevant error message. If it does check out, I send back a <success /> node. I wrote a pretty brief/general post on checking user input on my blog, you might find it useful: http://www.ironcoding.com/?p=37.
-
Deleted fine for me
-
As the error implies, $verif is not a MySQL resource as expected, but is instead null. Try printing mysql_error() after defining $verif and see what happens.
-
According to the manual: So the previous query did not generate an AUTO_INCREMENT, so either there's a mysql_error(), or the test table does not have an AUTO_INCREMENT field.
-
The way I handle dynamic forms is I create an array with them, so: <input type="hidden" name="id[]" /> <input type="hidden" name="id[]" /> Which, on the next page will translate into $_POST['id'][0]; $_POST['id'][1]; and so on.
-
Loads of answers if ya just google http://www.google.com/search?q=image+submit+button&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a. Basic run down: change the type attribute to image and create an src attribute and set it to the image url.
-
$result doesn't carry the actual result that you're looking for, it carries the resource id (like in the error message). What this basically means is it's a resource that other functions can tap into/use, like mysql_fetch_array. So you need to use mysql_fetch_array on your $result variable (like in the snippet of code you posted) which returns a string that you can put in your message. The line I added ($message .= $row['email']) will add each email address of each treesurgeon to the message. mysql_connect("db.hostedresource.com","treesurgery","password here"); mysql_select_db("treesurgery") or die("Unable to select database"); $code = $_GET['postcode']; $message = $_GET['message']; $result = mysql_query("SELECT email FROM treesurgeons WHERE postcode LIKE '%$code%' ORDER BY companyName LIMIT 3") or die(mysql_error()); echo "<h2>Business Names:</h2>"; while ($row = mysql_fetch_array( $result )) { $message .= $row['email']; echo " ".$row['email'] . "<br>"; } echo "<br>"; echo $message; mail( "[email protected]", "Header","$message" ); echo "Thank you for using our mail form.";
-
Fatal error: require() [function.require]...(include_path='.')
l4nc3r replied to escapo's topic in PHP Coding Help
First off, bad grammar is annoying. Clean it up. Secondly, your code is messy. You should be using single quotes for speed and readability, the require function should be called as a function, and there's no point in using a $userid variable -- just use the $_GET var. Now on to the actual problem -- does get_extra.php exist in the same directory as the file you're trying to include it from? -
Using HTTP_POST to auto fill and submit a form.(AutoLogin)
l4nc3r replied to tommytx's topic in PHP Coding Help
Not the biggest buff on cURL, but you should be posting the form processing page (ie, the form "action"), not the form itself. Looking on the page, it looks like the url the form is posting to is http://www.handy-hanky.com/shirley/success.php, so you'd want to change the url in your curl_setopt function to that. -
I take it your using PHP sockets? You might want to read up on non-blocking vs blocking sockets. Assuming you're in blocking mode now, you'd want to switch it over to non-blocking mode and accept all chat information through a single port. Lol yeah; you don't want to create a new socket over a new port for every chat.
-
Let's not be lazy, gesseg. There are plenty of places on the internet that explain how XML parsing in PHP works. Visit any one of them and read up and then build your own last.fm parser.
-
http://www.lmgtfy.com/?q=how+to+set+up+a+local+php+server
-
Here are the steps: 1. Learn English. 2. Learn English. 3. Learn how to ask a question. http://www.catb.org/~esr/faqs/smart-questions.html 4. Learn the difference between PHP and Javascript. 5. Learn how to use Google (note you might want to do this before step 4) :http://www.lmgtfy.com/?q=php+get+current+page+url
-
Well, this would be very helpful: http://tinyurl.com/yka2e56 But basically, in the database you have a table with categories and a table with images, like: categories: category_id, category_name images: image_id, category_id On the category page you would get all of the categories from the database and then print them out with urls to a page that would print out images with GET vars referencing a category. So.. while($cat = mysql_fetch_assoc($categoryQuery)) { echo '<a href="images.php?category='.$cat['category_id'].'" />'; } And then on images.php you would get images from the correct gallery from the database, so.. $sql = 'SELECT images FROM images WHERE category_id = "'.$_GET['category'].'"'; Add some error checking and the rest is obvious.
-
http://tinyurl.com/2dsykco
-
Instead of having him do it for you, why don't you RTFM? http://www.php.net/ http://www.w3schools.com/php/default.asp http://spreadsheets.about.com/od/excel101/a/Excel_beg_guide.htm Excellent answers ignance. Of course, if you have money, I'd be glad to do it for you.
-
Without looking too much in to it (a simple Google query for "last.fm API tutorial" would probably solve all of your problems), I assume the API returns XML. You might want to look up the SimpleXML library in PHP.
-
Have you tried debugging it? Lol. Print out the SQL query and put it directly in to MySQL. See what happens. Print out a mysql_error() right after each mysql_query() function. Also, I see you commented a "not sure about" in your source code. If you're not sure about something, why not look it up in the manual? Oh, and Google is always your friend: http://www.google.com/search?q=debugging+mysql+php&ie=utf-8&oe=utf-8&aq=t&client=firefox-a&rlz=1R1GGLL_en___US369
-
Ha, good point. It was probably made for *nix installations (I'm not sure what *nix's policy is on naming directories). If you have the .StdLib folder somewhere (on the internet?) just make your own StdLib folder without the period and put all of the files in there. Then do a find/replace in your scripts on all of the .StdLib 's and make them StdLib.
-
Shouldn't a single space be an illegal username anyways? lol Sounds like you need regular expressions. The PHP documentation has a great tutorial on them.