westman
-
Posts
600 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by westman
-
-
Thank you.
Then I am going to use 1 php file (main page) to do all the work.
There will be no page reloading as I am looping everything from the DB. first loop is message subject and inside that loop is a sub-loop to get the messages of all subjects.
I am sacrificing page load time for not reloading the page. -
Before I go ahead and start coding this I need some advice on functionality.
I don't know if I should run everything from my main page or use AJAX to call on a second php file.So this I what I am programming.
An inbox page like google.From pic1.PNG you can see my layout.
Once you click on the subject a div will show with the message history.
I will be taking all the info from my DB and creating more divs in php to dynamically echo to the popup div.
The problem...
JavaScript does not like my content ie ' " and line brakes.
If I have a second php file using AJAX would it work better? -
where do I start with this code?
-
the idea is this
$id1 = '123'; $id2 = '123'; $text =' <a class="link" href = "javascript:void(0)" onclick = "document.getElementById(\'test.php\').innerHTML=\''.$id1.'\';document.getElementById(\'test.php\').innerHTML=\''.$id2.'\';">Text</a> ';
then test.php will echo back information to the main page.
-
Using the same script at the top of this post.
How do I send the info to a php file instead of a div? -
hourly is working fine but just tested daily and it is not working.
Why?
-
thank you so much.
Very helpful. -
$string = 'Hello and hi'; $text =' <a class="link" href = "javascript:void(0)" onclick = "document.getElementById(\'text_div\').innerHTML=\''.$string.'\';">Text</a> ';
This is code I am using to print $string in text_div.
What syntax (characters) can I not pass through this script? -
I don't know what happened but I sent the cron job to run every hour and it works fine.
Now I am going to test it for daily as that is what I need. -
I have nothing in my error log.
How do I forces my cron job to log all actions using my cron job command? -
I put mysite/public_html/scripts/cron_day.php in my browser to run the code.
It worked with no problem.
I even looked for errors with this codeerror_reporting(E_ALL); ini_set('display_errors', '1');
There are no errors with the php file.
The cron job itself is not working.
Why? -
Hi there,
I made a cron job on godaddy and it worked for the first two days and now it is no longer working.
Here is my code.
0 10 * * * /usr/local/bin/php -q /home/mysite/public_html/scripts/cron_day.php
Why did it stop working?
What did I do wrong? -
It works very well.
thank you so so so so much -
then, would this work?
$Db1 = "1"; $Db2 = "2"; $Dbseen = "yes"; $stmt = $conn->prepare("SELECT id, user, title, date, show_post FROM post WHERE show_post = ? AND seen = ? OR show_post = ? AND seen = ? ORDER BY id DESC"); $stmt->bind_param("ssss", $Db1, $Dbseen, $Db2, $Dbseen);
???
-
as I would like to use AND and OR together, would this work?
$Db1 = "1"; $Db2 = "2"; $Dbseen = "yes"; $stmt = $conn->prepare("SELECT id, user, title, date, show_post FROM post WHERE show_post = ? AND seen = ? OR show_post = ? AND seen = ? ORDER BY id DESC"); $stmt->bind_param("sss", $Db1, $Dbseen, $Db2);
-
how do I use "OR" in MySQLi?
Here is what I have
$i = 0; $Db1 = "1"; $Db2 = "2"; $stmt = $conn->prepare("SELECT id, user, title, date, show_post FROM post WHERE show_post = ? ORDER BY id DESC"); $stmt->bind_param("s", $Db1); $stmt->execute(); $stmt->store_result(); //if($stmt->num_rows === 0) exit('No rows'); $stmt->bind_result($idRow, $userRow, $titleRow, $dateRow, $showRow); while ($stmt->fetch()) { $post_id[] = $idRow; $user[] = $userRow; $title[] = $titleRow; $date[] = $dateRow; $post_show[] = $showRow; $i++; // run a while loop } $stmt->close(); $conn->close();
I would like to use OR to look for
$Db1 = "1";
$Db2 = "2";
in my DB.
How do I use OR? -
-
-
-
-
-
My code is not working, here it is...
$stmt = $conn->prepare("SELECT id FROM users WHERE email = ?"); $stmt->bind_param("s", $email); $stmt->execute(); $numRows = $stmt->num_rows; $stmt->close(); if($numRows > 0) { $error = "Your Email is already in use. Please try another."; $conn->close(); }else{ // all good $conn->close(); }
any help?
-
Thank you so much.
So so so helpful.
Image security helps big time.
Happy holidays
-
lol that gave me the output of the longest url I have ever seen.
Thank you.
Question.
Can it be decoded?
Javascript in PHP
in PHP
Posted
Last piece of the puzzle.
I have coded everything and It works well apart from one aspect "JavaScript in php" the title of this post.
this is what I have.
This works fine.
but when I change
$text_div = $text;
to
$text_div .= '
<div style="clear:both;"></div>
'.$text.'
</div>';
There is a problem.
How do I fix it as I need to add css to different divs in the while loop.