-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
The biggest setback is the fact that you don't want to include #asdfasd. That one isn't actually inside an html tag the same way as #bbbbbb. By this logic..what would you say to the following? <p>#testing <span style="color: #bbbbbb">#asdfasd</span> #test</p> or <div>#testing <span style="color: #bbbbbb">#asdfasd</span> #test</div> or <body>#testing <span style="color: #bbbbbb">#asdfasd</span> #test</body> Point is virtually everything is "in" an html tag somehow. I can make a difference between #bbbbbb and the other 3, because #bbbbbb is part of a value in an html element attribute. But strictly speaking, there is no difference between #asdfasd and the #test or #testing. So first off, you need to be more specific about what you actually want to ignore. Anything inside an html tag or span tag specifically? In any case, regex isn't really the best tool for parsing html. You should instead use a DOM parser to traverse the html elements.
-
honestly I don't know what your hosting provider will or won't do for you..I've never done this stuff on a shared hosting account before, only a dedicated box :/
-
It's an actual password
-
Yeah i thought that would be the case...basically you're out of luck, since your script can't point to the certificate files. That's how it usually is on shared hosting. If you really really need to make this script work, you need to move to a dedicated box where you get full access and can point your script to the certificate files.
-
Cannot use string offset as an array when trying to echo an array
.josh replied to the5thace's topic in PHP Coding Help
Your array is only two levels deep..you are trying to echo it as if it is 5 levels deep. If you just want to dump the contents of the array for QA, do this: $bing_results[$b] = array ('url' => $value->Url, 'title' => $value->Title, 'snippet' => $value->Description, 'rank' => 100-$b); echo 'Lets see? : <br/>'; echo '<pre>'; print_r($bing_results[$b]); echo '</pre>'; $b++; If you want to echo individual elements, do for example this: $bing_results[$b]['url'] or $bing_results[$b]['title'] -
error_reporting(E_ALL); ini_set('display_errors', '1');
-
sidenote: if you can paste the path/to/file in your browser's address bar and it works, then it's not outside of your root directory.
-
Well you could have generated your own self-signed certificate on your server (assuming you have access to do so). Also FYI, modern browsers don't require a dedicated IP for SSL, though it probably wouldn't have been an option for you on a shared hosting plan anyways (but you can blame your host for that, not technology). Anyways, basically your next step would be to setup your server to handle SSL requests. This involves placing the certificate somewhere on your box and updating some Apache files (or whatever your server is). The exact steps will vary depending on your OS, Server, Server config, etc.. though, so I'm afraid I don't have any canned instructions for you.. but my thought is if you are using a hosting company and got the SSL cert from them and have a reseller account.. do they manage the box or are you paying for a dedicated server and have full root access? If they are involved in management, shouldn't they be setting that up for you? I mean because normally the the process for purchasing an SSL Cert involves you generating a certificate request file on your server to give to the SSL Authority to sign and then they give you the signed certificate. If you just went to your hosting account page and threw money at it and are now paying for it and didn't do any of that stuff, then either you got scammed or they set all that up for you on your server.
-
AJAX is the current "closest to" equivalent. However, you cannot make a request to an external URL unless the target server is specifically setup to allow cross domain requests. There's also web sockets, but it's still (kinda) new, and would also require the target server to be setup for it. So basically there is currently no way to use javascript to make an unsolicited request to an external domain, and this by design for security reasons.
-
See this comment in the manual for the settings to use. In addition, you will need to actually setup an SSL cert on the server running the code. You may possibly get away with a self-signed certificate, so I'd try that first, as it's the free option. Setting up an SSL cert is a bit lengthy but fairly straight forward; there are lots of tuts out there for it.
-
note that the target server may require you to identify yourself with a certificate, so ignoring cert validation may not be an option for you and you will have to properly set that up
-
The URL you are requesting is https.. do you care about it being SSL? If so then you are going to need to set the SSL settings properly. If not, then keep this one: CURLOPT_SSL_VERIFYPEER => false, and remove this one: CURLOPT_SSL_VERIFYHOST => 2,
-
Javascript popup window changes display style for different images
.josh replied to james909's topic in Javascript Help
shouldn't it be if(pic[c].src=="pics/Image1.png") -
If I had to take a guess, I'd say that you should be urlencoding $request_url, not htmlentitying it. echo out $request_url and compare it to how you would enter it in, in your browser url bar.
-
First, do not double post. Second...what? Your question makes no sense.
-
Okay well no, it's not the same thing. someFile.jpg is not the same as directory/someFile.jpg The file inside your zip is actually inside a directory "86 Crew - 2000 - Bad Bad Reggae/" so you need to include that in what you are passing to getStream Unless you have some other way of knowing exactly where it should be located within the zip, you're gonna have to go with a "best guess" approach. Here is the simplest way you can handle this: // search for a path/to/file matching file, returning the index of it $index = $z->locateName($file_name, ZipArchive::FL_NOCASE|ZipArchive::FL_NODIR); // get the name of the file based on the index $full_file_name = $zip->getNameIndex($index); // now get the stream $fp = $z->getStream($full_file_name); So here is the caveat with this: Let's say the zip file contains this: someFile.jpg dir1/someFile.jpg dir2/someFile.jpg locateStream returns the first match found, and this may or may not be what you are looking for. Only way to get exactly what you are looking for is to know exactly where to find it. So this approach may be okay for you (maybe your zips will only have the one file in it, and maybe your zips might sometimes actually have the files in a subdir or not). So maybe this will work for you, and if not..you need to figure out some way of enforcing knowledge of exact path/to/file to look for (getting it from a user, doing some manual labor on all your zip file(s) to map things, etc..).
-
yes.
- 2 replies
-
- links count fckeditor
- links
-
(and 3 more)
Tagged with:
-
we aren't here to do your homework for you
-
Ajax RPG Game Map - With PHP and SQL (a push in the right direction)
.josh replied to bamfon's topic in PHP Coding Help
Do you know any php and database programming at all? If not, I suggest you start with the traditional "hello world" tutorial. -
Contact Form | HTML Contact for to php or email
.josh replied to hussaiz36's topic in PHP Coding Help
If you want someone to do your work for you, post in the freelance forum. -
Where is this data coming from? If it is coming from a database then you should be able to alter your query to only select the highest value. If not, then you can do something like this: // init new array $newArrayList = array(); // loop through current multi-dim array foreach ($arrayList as $array) { // if entry for id is not yet set or if the current attempt is higher than previous attempt, add to newArrayList if ( !isset($newArrayList[$array[0]]) || ($array[3]>$newArrayList[$array[0]][3]) ) $newArrayList[$array[0]] = $array; } note: fyi for future reference, post the result of serialize($array) instead of just a var_dump; it makes it a lot easier for people to quickly reconstruct the array to play with.
-
huh..there seems to be a bug with getStatusString .. I tried out your code with an invalid filename and it is indeed returning "No error" .. Okay so do this: echo "passed filename: ".$file_name. "<br/>"; echo "files: <br/>"; $i=0; while ($fileName = $z->statIndex($i)) { echo $fileName['name'] . "<br/>"; $i++; } Not sure how big your zip file is so if there's lots of stuff in there then you'll get a lot of stuff echoing out, but goal here is to compare the value you are actually passing to $file_name vs. what is listed in the zip.
-
you don't even see your ajax call being made? If not, my first guess is that your jQuery click event is being executed before the link exists. If you are sure that it does exist (e.g. doing a console.log('clicked') or something as first line of the click callback) then my 2nd guess is your condition for ID is returning false (your php echo isn't echoing anything). Viewsource and verify that it is outputting an ID. If all this is lined up and you still aren't seeing it.. make sure the ID is unique to the element. sidenote: As far as the redirection to the top of the page, that's happening because of the href='#' in the link. You may need to change this: $('.more').on("click",function() { to this: $('.more').on("click",function(e) { e.preventDefault(); At face value that return false; should be preventing the href from triggering but you apparently have something else going on that's making it happen anyway.. kind of hard to figure out without seeing all this in action on your page. But it could just be happening because the click event is not getting triggered in the first place (refer to above things to check)