jazzman1
Staff Alumni-
Posts
2,713 -
Joined
-
Last visited
-
Days Won
12
Everything posted by jazzman1
-
Really ??? What could be happened if your web root is different or the index is inside the project folder?
-
Lol.....what a shame @mac_gyver I know what is a "tile" I've been working in construction areas when I came to Canada, but I really wanna thank you for this reply I cannot sleep well at last night.
-
Why you should have 4 titles? A table should not have repeating values and columns itself! Google - "Database optimization" or EXPLAIN your table data here.
-
EDIT: A little mistake I made, before a "?" symbol it should be a "\" symbol instead "/" to be escaped, sorry for that. No, no it's just fine
-
Assuming, that a /gallery is a sub-directory of your project. Inside /project/gallery/cuisine directories you have for example a index.php containing next links: /project/gallery/cuisine/index.php <a href="./index.php?nggpage=1linkid446">Link 1</a><br /> <a href="./index.php?nggpage=2linkid447">Link 2</a><br /> <a href="./index.php?nggpage=3linkid448">Link 3</a><br /> Inside the root directory of your project folder named above as "project" create your .htaccess file: RewriteEngine on RewriteCond %{REQUEST_URI} ^/project/gallery/cuisine/index\.php$ RewriteCond %{QUERY_STRING} ^nggpage=([0-9]+)[a-z]+([0-9]+)$ RewriteRule ^(.*)$ /project/gallery/cuisine/?ngpage=%1\?photoid=%2 [R=302,L] OR.... RewriteRule ^(.*)$ /project/gallery/cuisine?ngpage=%1\%3Fphotoid=%2 [R=302,NE,L]
-
Example 1: //Get the file from the remote machine $src = file_get_contents("https://cbonline.boekhuis.nl/pls/cover/p_get_cover_fe?p_hash=9C099FC9E2626377495DA02FD7F802B0"); //Store the image $fp = fopen("image.jpg", "w"); fwrite($fp, $src); fclose($fp); echo '<img src="image.jpg" alt="someImage" />'; Example 2: header("Content-Type: image/jpeg"); $src = 'https://cbonline.boekhuis.nl/pls/cover/p_get_cover_fe?p_hash=9C099FC9E2626377495DA02FD7F802B0'; $output = "image.html"; shell_exec("wget -q $src -O $output"); echo file_get_contents($output); There is a lot of options to download images from the remote machine and save it to the local one. CURL is an option also....
-
When I said - don't focus for now about something , I wanted to say just ignore for a moment the pdo count function and the try{}catch{} block because it is easy for debugging to get the result back. I don't have any idea what are you talking about by saying - the files' upload failed.
-
Is this binary file string comes from your database or you catch it from a remote server
-
Ok, don't focus to count and try{}catch{} for now. <?php if(isset($_POST["usernamecheck"])){ $username = preg_replace('#[^a-z0-9]#i', '', $_POST['usernamecheck']); //// query to check if the username is in the db already //// $unameSQL = $db->prepare("SELECT username FROM members WHERE username=:usernamecheck LIMIT 1"); $unameSQL->bindValue('usernamecheck',$username,PDO::PARAM_STR); $unameSQL->execute(); // execute the sql $row = $unameSQL->fetch(PDO::FETCH_ASSOC); // fetch the result echo $row['usernamecheck']; Enter the proper name to the html form, which you're 100% sure exist in the database and see if the result comes back. You can put down alert in this part of script: if(ajaxReturn(ajax) == true) { alert(ajax); _("unamestatus").innerHTML = ajax.responseText; } EDIT: I modified the php script above!
-
mod_rewrite with htaccess giving me weird action
jazzman1 replied to et4891's topic in Apache HTTP Server
This is a regular file: system.php // or just without extension to the end system This is a directory: system/ -
Stripping unwanted (extra) </table> tags
jazzman1 replied to qwikaddotcom's topic in PHP Coding Help
The htmlspecialchars function just predefined special html characters to their entites? Can you give us an example what do you mean? -
mod_rewrite with htaccess giving me weird action
jazzman1 replied to et4891's topic in Apache HTTP Server
Do you really understand my question? -
It depends how looks like the root directive in Apache conf, by default is: DocumentRoot "/var/www/html" When you create new projects on the same web root, you should avoid using absolute paths unless you really need them.
-
Stripping unwanted (extra) </table> tags
jazzman1 replied to qwikaddotcom's topic in PHP Coding Help
No, it's not corect You should make a "\s" as optional! -
You have to fetch the resut. Try, if(isset($_POST["usernamecheck"])){ $username = preg_replace('#[^a-z0-9]#i', '', $_POST['usernamecheck']); //// query to check if the username is in the db already //// $unameSQL = $db->prepare("SELECT username FROM members WHERE username=:usernamecheck LIMIT 1"); $unameSQL->bindValue('usernamecheck',$username,PDO::PARAM_STR); $unameSQL->execute(); // execute the sql $row = $unameSQL->fetch(PDO::FETCH_ASSOC); // fetch the result $count = $unameSQL->rowCount(); // count rows try{ echo $row['usernamecheck']; } catch(PDOException $e){ echo $e->getMessage(); $db = null; exit(); } echo $count; // free pdo connection $unameSQL = null;
-
I only want to know whether js sends a proper value to the server. So, on the top of the nameCheck.php put down next: echo '<pre>'.print_r($_POST, true).'</pre>'; Don't forget to change the html method attribute: <form name="signupform" id="signupform" onsubmit="return false;" class="form" method="post">
-
curl error.........on wheel loop..........help.....pls
jazzman1 replied to ShivaGupta's topic in PHP Coding Help
Try, // on the top of your script ob_start(); $i = 0; while($i != 50) { // Your code here // sleep for 10 seconds sleep(10); $i++; } //after the while loop ob_end_flush(); -
Stripping unwanted (extra) </table> tags
jazzman1 replied to qwikaddotcom's topic in PHP Coding Help
Where is the problem to use my script above? -
curl error.........on wheel loop..........help.....pls
jazzman1 replied to ShivaGupta's topic in PHP Coding Help
As I said you before never used curl in php only in bash without GUI. To be honest I don't know where this problem comes from without testing the same script into my machine, maybe it comes from the remote machine, maybe from the local one. So, you could try to set output_buffering to the script to see what happens using ob_start() and ob_end_flush(). -
curl error.........on wheel loop..........help.....pls
jazzman1 replied to ShivaGupta's topic in PHP Coding Help
You are surprising me every time What's the common between "firefox" and "curl" here? EDIT: My fault, you could use firefox as a default userAgent Try this: $i = 0; while($i != 50) { // Your code here // sleep for 10 seconds sleep(10); $i++; } -
I downloaded your image by this unix command: [jazz@centos-box ~]$ wget 'https://cbonline.boekhuis.nl/pls/cover/p_get_cover_fe?p_hash=9C099FC9E2626377495DA02FD7F802B0' --2013-05-26 10:37:05-- https://cbonline.boekhuis.nl/pls/cover/p_get_cover_fe?p_hash=9C099FC9E2626377495DA02FD7F802B0 Resolving cbonline.boekhuis.nl... 194.229.60.195 Connecting to cbonline.boekhuis.nl|194.229.60.195|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 79913 (78K) [image/jpeg] Saving to: “p_get_cover_fe?p_hash=9C099FC9E2626377495DA02FD7F802B0” 100%[=====================================================================================================================================================================>] 79,913 135K/s in 0.6s 2013-05-26 10:37:06 (135 KB/s) - “p_get_cover_fe?p_hash=9C099FC9E2626377495DA02FD7F802B0” saved [79913/79913] You could use the shell_exec function in php to pass the URL like variable.
-
By default Apache is using port 80 check whether this port is already used by another applications like Skype, Teamviewer, etc......
-
mod_rewrite with htaccess giving me weird action
jazzman1 replied to et4891's topic in Apache HTTP Server
System and application are directories inside /ci_intro or just files? -
Tip: Maping (array_map) $instruments and $connections and find out the commons indexes between them, then loop $connections through the second indexes and match them in $stores.
-
And the most important thing, don't forget to post out your solution to the forum