This topic is locked

ChatGPT

1/15/2023 1:31:31 PM
PHPRunner General questions
francesco author

I want to share my first experience with chatgpt. I was stuck on this problem to open a href link in a popup windows, (I don't have any experience in javascript):

$value = "<a href='http://localhost/output/commessa_edit.php?editid1=".$data["commessa"]."'>$comms</a>'>http://localhost/output/commessa_edit.php?editid1=".$data["commessa"]."'>$comms</a>";

i simply asked to open this link in a popup and it gave me almost exact response:

$value = "<a href='http://localhost/output/commessa_edit.php?editid1=".$data["commessa"]."'
onclick='window.open(\"http://localhost/output/commessa_edit.php?editid1=".$data["commessa"]."\",
\"popup\", \"width=600,height=600\"); return false;'>$comms</a>";
It only missed final ";
I think this be helpful for a lot of people not experienced in code writing
S
Steve Seymour 1/15/2023

Thanks.
I personally don't like using escape characters in code. I prefer to concat strings as it makes the code quicker to read/debug. - That may just be me.