0

I would like to know how does this class from:PHP Script to Edit DNS Records in CPanel posted by: Scott.

I would like to know how can I use this:

     $zones->addrecord($type, $target, $name, $ttl)

Because Im having this problem when I try to put the right name:

Uncaught exception 'Exception' with message 'Invalid name 'teste'..

I tried:

 $zones->addrecord('A', 'ip','somename', 14400)
Community
  • 1
  • 1
  • Welcome to StackOverflow. For you to consider, [What have you tried](http://www.whathaveyoutried.com)? What research have you done? (consider this and update your question) – UnholyRanger Jul 12 '13 at 17:44
  • Ok.I wrote what I tried. Sorry – user2577269 Jul 12 '13 at 17:46
  • Have you read the code you're working with? you're hitting line `84` which throws an exception that you don't catch. – UnholyRanger Jul 12 '13 at 17:49
  • Yes I have read.I saw there, the line is: if (!preg_match("/^([a-zA-Z0-9\-]+\.)*".preg_quote($this->zonedomain)."\.$/", $name)) { throw new Exception("Invalid name '$name'", 0); } – user2577269 Jul 12 '13 at 17:50
  • have you tried: `$zones->addrecord('A', '', 'somename..', 14400)`? The regex is checking for the zone domain too – UnholyRanger Jul 12 '13 at 18:02

0 Answers0