micah1701
-
Posts
613 -
Joined
-
Last visited
Posts posted by micah1701
-
-
hmm, this is starting to look more like a server configuration issue.
getting help from my web host is like pulling teeth :'(
Thanks for the help anyway.
-
good thinking... I'm getting two warnings:
Warning: file() [function.file]: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /path/to/my/file.php line #
and
Warning: file(http://www.google.com/) [function.file]: failed to open stream: Resource temporarily unavailable in /path/to/my/file.php line #
guess I'll go google those; maybe someone here can respond back in the meantime with a good interpretation.
-
no such luck.
the script works when run of another host so I'm thinking it might not be the code but the configuration settings? or not?
-
take out the 'single quote' before "Regards"
><br />'Regards,
-
I have allow_url_fopen turned on yet:
<?php if(!file("http://www.google.com") ){ echo "boo hiss, this doesn't work"; } ?>
using file() is returning false.
for that matter, so is fopen() and file_get_contents()
is there some other setting I'm missing other then "allow_url_fopen" that might be blocking my XSS?
-
thanks for once again padding your post count while giving absolutely no help whatsoever. I realize this is a PHP forum but it seem'd like a fairly simple question and I thought someone could help - since I've received and given much help through this site in the past.
-
I know how to do simple redirects with .htaccess but I have a slightly more complicated problem.
I have a several different pages of code from a client. Each page includes() other pages of code but those urls are coded coded into the application.
example:
<?php include_once($_SERVER['DOCUMENT_ROOT'].'/clients_subfolder/another_folder/some_php_code.php'); ?>
I need to work on this code on my own server but am running my scripts, for obvious reasons, in a differnt folder path.
Is there an easy way using .htaccess to "trick" all the existing code to look for the include files using my existing structure, instead of what's harded coded?
ie, the page /my/site/index.php looks to include the previously show file but the file really resides at /my/site/some_php_code.php
thanks!
-
try adding some slashies
<?php echo preg_replace('/£/', '',$ThisAmount); ?>
does that help?
-
not as a fix for your code that, other wise looks fine, try testing with something like this:
<?php $img = imagecreatefromjpeg ($filename); $x = imagesx ($img); $y = imagesy ($img); imagedestroy ($img); echo "$x x $y"; ?>
-
if you are getting the "header all ready sent" error it means that something has already been outputted to the browser before you called the header() function.
make sure you don't have any HTML or echo statements BEFORE your call to output a new header location.
-
here's what'd i do though.
1) explode() the query string into individual words.
2) remove common words like ("the," "what," "when," "is," "a," etc...) from your array using preg_match or eregi
3) build a query that will check through your table for questions that contain each word: LIKE '% $word %'
4) ta-da - show the results to the user.
-
I don't know the "best" way to do it -- but I would think it would involve keeping a seperate table of keywords then devising an algorithm to weight various words and phrases and make matches based on their score.
... or install a google box on your server http://www.google.com/enterprise/search/gsa.html
-
is it doing it every time or just sometimes?
it could be something as simple as the user going back to the page at a later time and the script being run again accidentally.
-
the or die is only for error handling. you can take it out once you've solved the problem.
if you leave it in, if there is an error with the query it will break your page. (probably a bad thing)
also, if someone does attempt a sql-injection, allowing them to see the error in your die() statement will just help them figure out how to improve their injection attack. I vote take it out.
-
it doesn't seem to like the value of $champion
two things
1) add single 'quotes' to the $comp var (unless the value is an integer):
$champion=mysql_query("SELECT * FROM competitions WHERE comp_name = '$comp' ");
2) check for errors in your sql statement:
$champion=mysql_query("SELECT * FROM competitions WHERE comp_name = '$comp' ") or die(mysql_error() );
-
your subject line says "remote file" but your message say's "remote site" which is it?
the first one is easy, the latter is a bit trickier as cross-site-scripting is difficult if you don't administer the second site. your best bet then is screen-scraping.
what exactly are you trying to do?
-
I re-read your post like 4 time and am still not sure what you're asking.
are you asking how to get the "sponsor type" from your table by passing it the sponsor type code?
if so, in this line:
$st = "Select * from sponsor_type where 'sponsor_type_code' = '$sponsor_type_code'";
just select the specific column (presumably named sponsor_type) instead of selecting *
$st = "Select sponsor_type from sponsor_type where 'sponsor_type_code' = '$sponsor_type_code'";
if not, could you maybe try to re-explain what the issue is?
-
maybe they look the same in browser but not in source? perhaps there's white space or something. what do you see if you try:
echo "<br>|".$row3['bundle_date'] . "| and curr date is |" . $current_date ."|";
is there space between any of the |pipes|?
-
try "application/octet-stream" instead of "application/msword"
if that doesn't do it, read up on the different MIME types for word docs, you'll find your answer
EDIT: Also, try sticking something like: echo $JobCV_Mime_Type; into your code and upload a file you know to be a word doc then see what specific mime type is echoed out. That'll help diagnose the problem.
-
or you could get all complicated and do something like:
<?php $n = 3.3912; $rounded = round($n,3); //shorten to 3 decimal places $parts = explode(".",$rounded); $decimal = $parts[1]; // = 391 $divided = round($decimal/ 125); // = 3 $new_decimal = $divided * .125; // = 0.375 $n = $parts[0] + $new_decimal; // = 3.375 echo $n; ?>
-
again, your quotes in the HTML are partially to blame, try:
<?php //..... echo "<tr><td>$row[Artist]</td><td>$row[Album] </td><td>$row[Price]</td><td>$row[ProductDesc]</td><td><img src=$row[image] /><td><a href=\"cart.php?ProductId=$row[ProductId]\">Add Item</a></td> </tr>\n"; //.... ?>
I moved the " in your <a> tag to after the href= and then I \escaped it so it would screw up the quote marks that your echo statement is in
-
for starters, your HTML has the "quotes" in the wrong place, and your PHP is not in between PHP tags.
you need something like:
<td><a href="cart.php?ProductId=<?php echo $row[ProductId]; ?>">Add Item</a></td>
-
or use varchar and any format you want.
thats a good idea too - unless later you're going to want to compare dates in mysql (such as searching for users born before 1985 or who are x number of years old).
-
MySQL stores dates as YYYY-MM-DD
there are a zillion things you can do. look into strtotime() and date() functions.
The simplest thing though, since you know the format coming in and just need to convert it is to explode the string and reorganize the values:
<?php $users_input_dob = "31/12/95"; $parts = explode("/",$users_input_dob); //$parts[0] = 31 $parts[1] = 12 $parts[2] = 95 $newDate = "19".$parts[2]."-".$parts[1]."-".$parts[0]; echo $newDate; //returns 1995-12-31
Drop down on click select stay
in PHP Coding Help
Posted
something like: