jazzman1
Staff Alumni-
Posts
2,713 -
Joined
-
Last visited
-
Days Won
12
Everything posted by jazzman1
-
$_SERVER["REMOTE_USER"] blank.. but not really?
jazzman1 replied to jgauthier's topic in PHP Coding Help
Are you able to apply some debugging steps? Any errors? This would be a good start for us. -
How the searchable domain name should be? Something like: http://domain.com OR https://domain.com OR domain.com or... by ip address v4 or v6? 123.123.123.123
-
What errors did you get using Barand's script?
-
MAMP/Apache Server on localhost running very slow
jazzman1 replied to frshjb373's topic in PHP Installation and Configuration
Hey @frshjb373, first of all I wanna tell you that rarely providing my help to mac or windows users using some app's like MAMP, WAMP, XAMPP etc....b/s I don't use these OS's. So, open up mac's console and give me the result of next output: ping localhost -c 5 Also, try to reach Apache server by IPv4 and IPv6 addreses Open up the browser and try: URL 1: http://127.0.0.1:8888 URL 2: http://[::1]:8888 -
@OP, if you want to learn and improve your skills in SQL, I recommend you to start with SQL exercises in this web site - http://www.sql-ex.ru. @Barand, do you know it? If no..you will be surprise I guess.
-
You need to JOIN 4 tables according the sakila Database EER Diagram. This is mine: SELECT f.title, f.description,l.name FROM film f INNER JOIN language l using(language_id) INNER JOIN film_category fc using(film_id) WHERE fc.category_id IN ( SELECT category_id FROM category WHERE name = 'Documentary')
-
Try to add manually more than one email. Something like - <?php $mail = new SendGrid\Mail(); $mail-> addTo('foo1@bar.com','foo2@bar.com','foo3@bar.com')-> setFrom('me@bar.com')-> setSubject('Subject goes here')-> setText('Hello World!')-> setHtml('<strong>Hello World!</strong>'); // send emails $sendgrid-> web-> send($mail); ?>
-
Can I see the format of all emails after imploding? while($row = mysql_fetch_assoc($query)) { $name[] = $row['name']; $email[] = $row['email']; } $email = implode(",", $email); echo $email;
-
Then don't use CONCATE_GROUP().
-
Can you show us the output of next foreach: foreach($categories as $sub_cat_id => $row): echo "<div id='subcat_list'>".strtoupper($row['subcat']['name'])."</div>"; foreach($row['topics'] as $sub_id => $sub_row): // here echo "<pre>".print_r($sub_row,true)."</pre>"; endforeach; echo "<br>"; endforeach;
-
Does the foreign key sub_id int(11) column in the topic table have a group of repeating values like the master's table?
-
Then, you have to show us your database schema for those two tables and some sample of data.
-
It should work I think. What happens if you run the sql code directly to the db server via phpmyadmin or mysql workbench
-
Try to remove the comma before a LIMIT clause, not sure that this syntax is proper.
-
Then, GROUP BY each subcategory entries which exist in datatb table, count only these which have for example minimum 10 records using a HAVING clause and finaly LIMIT them to 5. That's all. PS: My logic about this query here is something like that: $result = mysql_query(" SELECT s.sub_cat_id, s.category_id, s.sub_cat_name, t.id, t.topic_title FROM subcategory s INNER JOIN datatb t ON (s.sub_cat_id=t.sub_id) GROUP BY s.sub_cat_name HAVING(COUNT(*) >= 1) ORDER BY s.sub_cat_id $DESC_ASC, t.id $DESC_ASC LIMIT 5");
-
ob_clean() and flush() functions have nothing to do unless the output buffering being enabled in the php configuration script or you called ob_start() somewhere on your own script manualy starting this buffer. So, my advise is to avoid using it here. Try again without any buffering. Here it is: <?php // get the current working directory //echo __DIR__; exit; // define the name of the zip file $fileName = 'file.zip'; // set the path to zip directory and file name $path = __DIR__ . '/downloads/zip/'.$fileName; header("Content-Type: application/x-zip-compressed"); header('Content-Disposition: attachment; filename=' . basename($path)); header("Content-Transfer-Encoding: binary"); header('Pragma: no-cache'); header('Expires: 0'); header('Content-Length: ' . filesize($path)); readfile($path); Here, my working directory on my local machine is named - /var/www/html/public_html/pdo/ The path to the zip directory is - /var/www/html/public_html/pdo/downloads/zip/
-
When I moved the zip file in the same directory where the script is - it works. The script is: <?php $name = "test.zip"; header("Content-Type: application/x-zip-compressed"); header('Content-Disposition: attachment; filename='. basename("$name")); header("Content-Transfer-Encoding: base64"); header('Pragma: no-cache'); header('Expires: 0'); header('Content-Length: ' . filesize("$name")); readfile("$name"); I will try later on to see where the problem is b/s don't have the time to get into it
-
Attach this file.zip here I wanna test it on my local server. Don't attach anything I tried with another zip file and the result was like yours. I will try later again. There is something wrong.
-
Try to replace the empty character with underscore(_) using str_replace() php function.
-
Is there a real zip file with this name - 2.0 (5).zip?
-
Can I see the output of: echo myfiles/$name
-
Try, if($type == "application/x-zip-compressed"){ header("Content-Type: application/x-zip-compressed"); header('Content-Disposition: attachment; filename='. basename("myfiles/$name")); header("Content-Transfer-Encoding: binary"); header('Pragma: no-cache'); header('Expires: 0'); header('Content-Length: ' . filesize("myfiles/$name")); readfile("myfiles/$name"); }
-
PHP newbie having trouble with php5 on debian 7.2
jazzman1 replied to phantom21's topic in PHP Installation and Configuration
Maybe you were trying to display the content of the file in your browser with URL like - http://var/www/test.php or something similar- 16 replies
-
- php5
- debian 7.2
-
(and 1 more)
Tagged with:
-
PHP newbie having trouble with php5 on debian 7.2
jazzman1 replied to phantom21's topic in PHP Installation and Configuration
Then try, php -f /var/www/test.php You can also check for apache errors in the apache error log file.- 16 replies
-
- php5
- debian 7.2
-
(and 1 more)
Tagged with:
-
PHP newbie having trouble with php5 on debian 7.2
jazzman1 replied to phantom21's topic in PHP Installation and Configuration
Try to run the script into a terminal. For example: php-cgi /var/www/test.php Most likely the browser (apache or someone else) doesn't have permission to read the content in /var/www.- 16 replies
-
- php5
- debian 7.2
-
(and 1 more)
Tagged with: